#include #include #include #include #include #include #include using namespace std; typedef long long LL; const int MAXN = 1e5 + 1; int a[MAXN], p[MAXN]; bool vis[5001]; int main() { int t; scanf("%d", &t); while(t--) { int n, m; scanf("%d%d", &n, &m); int sum = 0; for(int i = 1; i <= n; i++) { scanf("%d", &a[i]); sum += a[i]; p[i] = sum % m; } memset(vis, false, sizeof(vis)); bool flag = false; for(int i = 1; i <= n; i++) { if(p[i] == 0 || vis[p[i]]) { flag = true; break; } vis[p[i]] = true; } printf(flag ? "YES\n" : "NO\n"); } return 0; }