#include #include using namespace std; const int maxn=100010; int num[5010]; int main(){ int t; cin>>t; while(t--){ memset(num,0,sizeof(num)); int n,m,sum=0; cin>>n>>m; int x; bool flag=false; for(int i=0;i>x; sum=(sum+x)%m; if(num[sum]){ flag=true; }else{ num[sum]=1; } } if(flag) cout<<"YES"<