#include #include #include #include #include #include #define pb push_back #define LL long long using namespace std; const int N = 100010; int a[N], sum[N]; bool vis[5555]; int main() { int T; scanf("%d", &T); while (T--) { int n, m; scanf("%d%d", &n, &m); bool ok = 0; memset(vis, 0, sizeof vis); for (int i = 1; i <= n; ++i) { scanf("%d", &a[i]); sum[i] = sum[i - 1] + a[i]; sum[i] %= m; if (sum[i] == 0 || vis[sum[i]]) ok = 1; vis[sum[i]] = 1; } if (ok) puts("YES"); else puts("NO"); } return 0; }