#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef pair PII; typedef pair PIII; #define PB push_back #define FI first #define SE second #define gcd(x, y) __gcd(x, y) #define gcd3(x, y, z) __gcd(__gcd(x, y), z) const double EPS = 1e-8; const double PI = acos(-1.0); const int INF = 0x3f3f3f3f; const LL INFL = 0x3f3f3f3f3f3f3f3fLL; const int MAXN = 100000 + 10; const int MOD = 1000000007; int a[MAXN]; int sum[MAXN]; int vis[MAXN]; int main() { int T, cs = 1; scanf("%d", &T); while (T--) { int n, m; scanf("%d%d", &n, &m); memset(vis, 0, sizeof(vis)); for (int i = 1; i <= n; ++i) { scanf("%d", &a[i]); sum[i] = sum[i - 1] + a[i]; vis[sum[i] % m]++; } int flag = 0; for (int i = 0; i < m; ++i) { if (vis[i] >= 2 || (i == 0 && vis[i])) { flag = 1; break; } } puts(flag ? "YES" : "NO"); } return 0; }