#include #include int dp[100010]; int main() { int T; int n, m, i, j, a; scanf("%d", &T); while (T--) { scanf("%d %d",&n,&m); int peace = 0; memset(dp, 0, sizeof(0)); for (i = 1; i <= n; i++) { scanf("%d",&a); dp[i] = dp[i - 1] + a; if (peace == 0) { for (j = 0; j < i; j++) { if ((dp[i] - dp[j]) % m == 0) peace = 1; } } } if (peace) printf("YES\n"); else printf("NO\n"); } return 0; }