#include #include #include using namespace std; const int N = 5050; int g[N]; int main(void) { int T; scanf("%d", &T); while(T--) { int n, m; int i; memset(g, 0, sizeof(g)); scanf("%d%d", &n, &m); int x; int sum = 0; int ans = 0; g[0] = 1; for(i = 1; i <= n; i++) { scanf("%d", &x); sum = (sum+x)%m; if(g[ sum ]) ans = 1; g[sum] = 1; } if(ans) printf("YES\n"); else printf("NO\n"); } return 0; }