#K52942. Transform Sequence to Zeros
Transform Sequence to Zeros
Transform Sequence to Zeros
You are given a sequence of n integers and an integer x. Your task is to determine whether it is possible to transform the entire sequence into a sequence of zeros using a special allowed operation. The allowed operation is based on the following observation:
If there exists at least one element a in the sequence such that $$a \mod x = 0$$, then the transformation is considered possible, and you should output "Yes". Otherwise, output "No".
Note: The transformation does not involve modifying every element. It is sufficient to check for the existence of an element that is divisible by x.
inputFormat
The first line of input contains two space-separated integers n and x. The second line contains n space-separated integers representing the sequence.
outputFormat
Output a single line containing either "Yes" if there is at least one element in the sequence for which $$a \mod x = 0$$; otherwise, output "No".## sample
5 7
4 14 3 10 5
Yes