#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define getmid(l,r) ((l) + ((r) - (l)) / 2) #define MEM(a,b) memset(a,b,sizeof(a)) #define MP(a,b) make_pair(a,b) #define PB push_back typedef long long ll; typedef pair pii; const double eps = 1e-8; const int INF = (1 << 30) - 1; const int MAXN = 100010; int n,T,m; int A[MAXN],sum[MAXN],vis[5010]; int main(){ scanf("%d",&T); while(T--){ scanf("%d%d",&n,&m); for(int i = 1; i <= n; ++i){ scanf("%d",&A[i]); } memset(vis,0,sizeof(vis)); int sum = 0,f = 0; vis[0] = 1; for(int i = 1; i <= n; ++i){ sum += A[i]; sum %= m; vis[sum]++; if(vis[sum] == 2){ f = 1; break; } } if(f) printf("YES\n"); else printf("NO\n"); } return 0; }