#include #include using namespace std; const int N = 1e5 + 5; int n, m, a[N]; int main() { int t; scanf("%d", &t); while (t--) { scanf("%d %d", &n, &m); bool F[5555] = {0}; F[0] = 1; int S = 0; for (int i = 1; i <= n; i++) scanf("%d", a + i); bool k = 1; for (int i = 1; i <= n; i++) { S = (S + a[i]) % m; if (F[S]) { printf("YES\n"); k = 0; break; } F[S] = 1; } if (k) printf("NO\n"); } return 0; }