#T180. 判断整除

判断整除

Description

Given a sequence of positive integers, insert a + or - sign before each number and calculate their sum.

For example, the sequence: 1, 2, 4 has a total of 8 possible sign combinations:

(+1) + (+2) + (+4) = 7
(+1) + (+2) + (-4) = -1
(+1) + (-2) + (+4) = 3
(+1) + (-2) + (-4) = -5
(-1) + (+2) + (+4) = 5
(-1) + (+2) + (-4) = -3
(-1) + (-2) + (+4) = 1
(-1) + (-2) + (-4) = -7

If at least one of the results in the sequence is divisible by the integer ( k ), we say that this positive integer sequence is divisible by ( k ).
For example, the sequence mentioned above is divisible by 3, 5, and 7, but not by 2, 4, 6, 8, etc.
Note: 0, -3, -6, -9, etc., can all be considered multiples of 3.

Input Format

The first line of input contains two numbers: ( N ) (( 2 < N < 10000 )) and ( k ) (( 2 < k < 100 )), where ( N ) represents the total number of integers in the sequence, and ( k ) represents the divisor.
The second line provides the ( N ) integers in the sequence, each ranging between 0 and 10000 (duplicates are possible).

Output Format

If the positive integer sequence is divisible by ( k ), output YES; otherwise, output NO. (Note: Use uppercase letters.)

3 2
1 2 4

NO