2749Sum of Subsequence

2749   Sum of Subsequence

题目描述

There are a sequence of numbers a1,a2,...,an, and a number m. You should choose some numbers from the sequence and the sum of numbers is divisible by m.

输入格式:

The first line is a positive integer T (T<=20), which represents the number of cases.

For each case, the first line contains two positive integers n, m (1<=n<=1,000,000; 1<=m<=1,000).

The second line contains n integers a1,a2,...,an (0<=ai<=1,000,000,000).

输出格式:

Output one line per case, either "YES" (without the quotes) if you can choose the subsequence that the sum of numbers in it is divisible by m, or "NO" (without the quotes), if such subsequence doesn't exist.

输入样例 复制
2
3 6
1 2 3
3 7
1 2 3
输出样例 复制
YES
NO

说明

1
20
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度