#include #include #include #include #include #include #include #define ll long long #define ull unsigned long long #define INF 99999999 using namespace std; int n, m; int a[101000]; bool flag[10100]; void getData() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); } void solve() { int sum = 0; memset(flag, 0, sizeof(flag)); flag[0] = 1; for (int i = 1; i <= n; i++) { sum += a[i]; sum %= m; if (flag[sum]) { puts("YES"); return; } flag[sum] = 1; } puts("NO"); return; } int main() { int t; scanf("%d", &t); while (t--) { getData(); solve(); } return 0; }