#include #include #include #include #include #include #include #include #include #include #include #define X first #define Y second using namespace std; typedef long long ll; typedef pair pii; const int maxn=100010; int N[maxn]; int Tong[6000]; int main() { int T; scanf("%d",&T); while (T--) { memset(Tong,0,sizeof(Tong)); int n,m; scanf("%d%d",&n,&m); for (int i=1;i<=n;i++) scanf("%d",&N[i]),N[i]=(N[i-1]+N[i])%m; int ok=0; for (int i=1;i<=n;i++) if (Tong[N[i]]) { ok=1; break; } else Tong[N[i]]=1; if (Tong[0]) ok=1; printf("%s\n",ok?"YES":"NO"); } return 0; }