Josh has a wall of colour
In his storeroom, Josh finds
- First, select one bucket of paint.
- Then, evenly divide the paint in this bucket amongst the remaining buckets. The chosen bucket is then discarded.
- If paint of colour
was poured into a bucket of paint of colour , then the bucket will now contain paint of colour , due to the mysterious chemical properties of the paint.
Here,
Can you help Josh determine whether he can end up with exactly one bucket, with this bucket containing paint of colour
Constraints
Subtask 1 [20%]
Subtask 2 [50%]
Subtask 3 [30%]
No additional constraints.
Input Specification
The first line contains two space-separated integers,
The second line contains
Output Specification
On a single line, output YES
if Josh can end up with a single bucket containing paint of colour NO
otherwise.
Sample Input 1
3 1
1 2 3
Sample Output 1
YES
Explanation for Sample Output 1
Initially, there are three buckets, containing paint of colours
First, Josh can pour the paint in bucket
At this point, Josh has two buckets, containing paint of colours
Sample Input 2
3 4
1 2 3
Sample Output 2
NO
Comments