#T744. 判断整除

判断整除

Here's the translation of the provided Chinese text into English while preserving all formatting:

## Description

Given a sequence of positive integers, insert either a + or - sign before each number and calculate their sum. For example, the sequence: 1, 2, 4 has 8 possible 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 is divisible by the integer k, we say this positive integer sequence is divisible by k. For instance, the above sequence is divisible by 3, 5, 7, but not by 2, 4, 6, 8, etc. Note: 0, -3, -6, -9, etc. are all 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 count of numbers in the sequence, and k is the divisor. The second line lists the N integers in the sequence, each ranging between 0 and 10000 (duplicates are allowed).

## 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

Source

CodesOnline