By Kay Akashi
Given an array consisting of integers , …, , you can do a following operation to each element only once: choose any integer and add to an element.
As a result of performing the operations to all the elements in the array, can you make all the elements equivalent?
, , .
The first line of input contains two integers, and . The second line of input contains integers that form an array .
Output "Yes" if you can make all the elements of equivalent. Otherwise, output "No".
5 2
-1 3 2 2 0
Yes
You can create the new array by adding following numbers to each element respectively: . As a result of those operations, the new array consists of only and the goal is achieved. Hence the answer is "Yes".
4 1
-83 -10 910 23
No