You are given a sequence of numbers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>, and a number *m*.

Check if it is possible to choose a non-empty subsequence *a*<sub class="lower-index">*i*<sub class="lower-index">*j*</sub></sub> such that the sum of numbers in this subsequence is divisible by *m*.
The first line contains two numbers, *n* and *m* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>, 2 ≤ *m* ≤ 10<sup class="upper-index">3</sup>) — the size of the original sequence and the number such that sum should be divisible by it.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
def subset_sum(nums, total):
    dp = [False] * (total + 1)
    dp[0] = True
    n = len(nums)

    for i in range(1, n + 1):
        for j in range(total, -1, -1):
            if j - nums[i - 1] >= 0:
                dp[j] |= dp[j - nums[i - 1]]

    return dp[total]


def solve(tc):
    n, m = map(int, input().split())
    v = list(map(int, input().split()))

    def sum_vector(vec):
        return sum(vec)

    sum_val = sum_vector(v)
    ans = False
    v.sort()
    if v[0] == 0:
        print("yes")
        return

    subset_sum(v, m * (sum_val // m))
    for i in range(1, (sum_val // m) + 1):
        if i * m < sum_val:
            ans |= dp[i * m]

    if ans:
        print("yes")
    else:
        print("no")


def main():
    t = 1
    # t = int(input())
    for i in range(1, t + 1):
        solve(i)


if __name__ == "__main__":
    main()
