#include #include #include #include #define M 100005 #define Tl tree[l] #define Tr tree[r] #define Tp tree[p] #define lson l,mid,p<<1 #define rson mid+1,r,p<<1|1 #define rep(i,s,t) for(int i=s;i<=t;++i) #define rrep(i,s,t) for(int i=s;i>=t;--i) bool mark[5005]; using namespace std; inline void Rd(int &res){ char c;res=0; while(c=getchar(),c<48); do res=res*10+(c&15); while(c=getchar(),c>47); } int n,m; int A[M]; int main(){ int T; scanf("%d",&T); while(T--&&scanf("%d %d",&n,&m)){ memset(mark,0,sizeof(mark)); int sum=0,flag=0; rep(i,1,n){ Rd(A[i]); sum+=A[i]; sum%=m; if(mark[sum]){ flag=1; }mark[sum]=1; } if(flag)puts("YES"); else puts("NO"); } return 0; }