P19360 [CodeChef] LINSUB
普及
题目描述

This time minions are celebrating Diwali Festival. There are N minions in total. Each of them owns a house. On this Festival, Each of them wants to decorate their house. But none of them have enough money to do that. One of the minion, Kevin, requested Gru for money. Gru agreed for money distribution but he will be giving money to a minion if and only if demanded money is less than or equal to the money Gru have. Now Gru wonders if he can spend all the money or not.

-----Input-----
First line have number of test cases T. Each test case consist of Two Lines. First line contains two space separated integers N and K i.e. Number of minions and Amount of Money Gru have. Next line contains N space separated integers A1,A2,A3,.....,AN representing amount of money demanded by ith minion.

-----Output-----
Output YES if Gru can spend his all of the money on minions i.e. after distribution Gru have zero amount of money else NO.

-----Constraints-----
- 1 ≤ T ≤ 105
- 1 ≤ N ≤ 102
- 1 ≤ K,Ai ≤ 109

-----Example-----
Input:
2
4 9
5 2 2 4
4 9
5 2 18 3

Output:
YES
NO

-----Explanation-----
Example case 1.At first Gru is having 9 Rs. If he gives 5 Rs. to first minion then remaining 4 Rs. can be given to 2nd and 3rd minion or to the 4th minion. Which will leave zero amount of money in the hands of Gru.
Example case 2.At first Gru is having 9 Rs. If he gives 5 Rs. to the first minion then from remaining 4 Rs. either he can give 2 Rs. to the 2nd minion or 3 Rs. to the fourth minion. Which will leave either 2 Rs. or 1 Rs. in the hands of Gru.

输入格式

见题面

输出格式

见题面

样例输入
['2', '4 9', '5 2 2 4', '4 9', '5 2 18 3']
样例输出
['YES', 'NO']