7303: CodeChef LECANDY - Little Elephant and Candies
Description
A Little Elephant and his friends from the Zoo of Lviv like candies very much.
There are N elephants in the Zoo. The elephant with number K (1 ≤ K ≤ N) will be happy if he receives at least AK candies. There are C candies in all in the Zoo.
The Zoo staff is interested in knowing whether it is possible to make all the N elephants happy by giving each elephant at least as many candies as he wants, that is, the Kth elephant should receive at least AK candies. Each candy can be given to only one elephant. Print Yes if it is possible and No otherwise.
Input
Output
Constraints
1 ≤ N ≤ 100
1 ≤ C ≤ $10^9$
1 ≤ $A_K$ ≤ 10000, for K = 1, 2, ..., N
Sample 1 Input
2
2 3
1 1
3 7
4 2 2
Sample 1 Output
Yes
No
Case 1. We can give one candy to the first elephant and two candies to the second elephant and make them both happy. Hence the answer is Yes. Alternatively we can give one candy to each elephant and left one candy for ourselves but they again will be happy.
Case 2. Even if we give four candies to the first elephant and two candies to the second elephant we will have only one candy left and can not make last elephant happy since he needs two candies for his happiness. Hence the answer is No.