/*************************************** Authur : zzblack ** Created: 2016-07-30 ** Orz ** ****************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ls id<<1,l,mid #define rs id<<1|1,mid+1,r #define OFF(x) memset(x,-1,sizeof x) #define CLR(x) memset(x,0,sizeof x) #define MEM(x) memset(x,0x3f,sizeof x) typedef long long ll ; typedef pair pii ; const int maxn = 1e5 + 50 ; const int maxm = 1e6 + 50; const double eps = 1e-10; const int max_index = 62; const int inf = 0x3f3f3f3f ; const int MOD = 1e9+7 ; inline int read(){ char c = getchar(); while (!isdigit(c)) c = getchar(); int x = 0; while (isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); } return x; } int Hash[maxn]; int main () { #ifdef LOCAL freopen("C:\\Users\\zzblack\\Desktop\\case.in","r",stdin); freopen("C:\\Users\\zzblack\\Desktop\\case.out","w",stdout); #endif int T = read(); while (T--) { memset(Hash, 0x00, sizeof Hash); int n = read(), m = read(); ll sum = 0; int flag = 0; while (n--) { int x = read(); sum += x; sum %= m; if (Hash[sum]) flag = 1; Hash[sum] = 1; } if (flag) puts("YES"); else puts("NO"); } return 0; }