/*#include #include #include #include #include #include #include #include #include #include using namespace std; const int nops = 4294967295; typedef long long ll; const int maxn = int(2e5) + 100; */ #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define esp 1e-8 const double PI = acos(-1.0); const int inf = 1000000005; typedef long long ll; const long long mod = 1000000007; //freopen("in.txt","r",stdin); //输入重定向,输入数据将从in.txt文件中读取 //freopen("out.txt","w",stdout); //输出重定向,输出数据将保存在out.txt文件中 int vis[5005]; int a[100005]; int main() { int t, n, m, i, j; scanf("%d", &t); while (t--) { scanf("%d%d", &n, &m); int ans = 0; int s = 0; memset(vis, 0, sizeof(vis)); for (i = 1; i <= n; ++i) { scanf("%d", &a[i]); s += a[i]; s %= m; if (!vis[s]) vis[s] = 1; else { ans = 1; } } if (ans) printf("YES\n"); else printf("NO\n"); } }