#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int maxn = 1e5+100; const ll inf = 0x3f3f3f3f; ll n, m; int flag[100005], a[100005]; int main() { int T; cin>>T; while(scanf("%d%d",&n,&m)==2) { memset(flag, 0, sizeof flag); for(int i = 0; i < n; i++){ scanf("%d",&a[i]); a[i]%=m; } int s = 0; int sign = false; for(int i = 0; i < n; i++){ s += a[i]; s %= m; if(flag[s]){ sign = true; break; }else flag[s] = 1; } printf("%s\n",sign?"YES":"NO"); } return 0; }