Problem H
Pillow Stacking
Eleanor has recently lost her favorite pillow. Being very
particular about her pillows, she categorizes pillows by their
softness. The pillow she lost had softness
In other words, the
Eleanor has a lot of money and is willing to use an unlimited amount of each pillow type she has access to. Can you help her determine if there is a way to stack pillows to reach her desired softness?
Input
The first line of input contains two integers
Output
If it is possible for Eleanor to stack pillows to reach
softness
Sample Input 1 | Sample Output 1 |
---|---|
1 1000 1 |
YES |
Sample Input 2 | Sample Output 2 |
---|---|
1 5 4 |
NO |
Sample Input 3 | Sample Output 3 |
---|---|
2 100 51 98 |
YES |