#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);}) #define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define rd_signed() ({int _s=*rp=='-'&&++rp,_v=rd();_s?-_v:_v;}) int main(){ rd_init(); unsigned n=rd(); unsigned m=(n&-n)-1; n/=n&-n; unsigned t=~0/n; unsigned i=n; i*=2-n*i; i*=2-n*i; i*=2-n*i; i*=2-n*i; int b=rd_signed(); while(*rp){ int a=rd_signed()-b; a=a<0?-a:a; if(a&m||a*i>t){ write(1,"No",2); _exit(0); } } write(1,"Yes",3); _exit(0); }