#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define RD(v) int v=0;{int c;while(c=*rp++-48,c>=0)v=v*10+c;} main(){ char*rp=mmap(0l,2400l<<10,1,2,0,0ll); while(*rp++!=32); RD(h); long x=1; do { rp+=*rp==45; RD(a); x=x*a%h; }while(*rp); write(1,"NO YES"+(x?0:3),3); _exit(0); }