var t,l,i,j,n,m,x:longint; sum:array[0..100000] of longint; flagg:array[0..100000] of boolean; flag:boolean; begin readln(t); for l:=1 to t do begin fillchar(sum,sizeof(sum),0); fillchar(flagg,sizeof(flagg),false); readln(n,m); flag:=false; for i:=1 to n do begin read(x); sum[i]:=sum[i-1]+x; if flagg[sum[i] mod m] then flag:=true; flagg[sum[i] mod m]:=true; if (sum[i] mod m=0) then flag:=true; end; readln; if flag then writeln('YES') else writeln('NO'); end; end.