#include #include #include using namespace std; const int MAXN = 100002; int main() { int a[MAXN], n, k, t, b[MAXN]; scanf("%d", &t); while(t--) { scanf("%d%d", &n, &k); for(int i = 0; i < n; i++) { scanf("%d", &a[i]); } memset(b, 0, sizeof(b)); int flag = 0; for(int i = 0; i < n; i++) { for(int j = i; j >= 0; j--) { b[i] = (b[i] +a[j])%k; if(b[i] % k == 0) { flag = 1; printf("YES\n"); break; } } if(flag == 1) break; } if(flag == 0) printf("NO\n"); } return 0; }