#t316. 判断整除
判断整除
Divisibility Check
Problem Background
Special for beginners, ^_^
Problem Description
For a given sequence of positive integers, insert a + or - sign before each number and compute their sum. For example, the sequence 1, 2, 4 has 8 possible signed sums:
(+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 all the results is divisible by the integer , we say this sequence of positive integers is divisible by . For example, the sequence above is divisible by but not by . Note that are all considered multiples of .
Input Format
The first line contains two numbers: () and (), where is the number of integers in the sequence and is the divisor. The second line gives the integers of the sequence, each between and (possibly with repeats).
Output Format
If the sequence is divisible by , output YES; otherwise output NO. (Note: all uppercase letters.)
Sample Input 1
3 2
1 2 4
Sample Output 1
NO
Constraints
1s, 1024KiB for each test case.