ll@N,c;VI@A(N);setS{A};while(N>1){setT;while(S.size()){S.erase(A=*S.begin());rep(i,N)rep(j,N)if(i!=j){modint a=A[j];if(a==0)wt("YES"),exit(0);VI B(N-1);c=0;rep(k,N)if(k!=i&&k!=j)B[c++]=A[k];VI C{A[i]+a,A[i]-a,A[i]*a,A[i]/a};rep[C](c,4)B[N-2]=c,T.insert(B);}}S=T;N--;}while(S.size()){S.erase(A=*S.begin());if(A[0]==0)wt("YES"),exit(0);}wt("NO");