ll get(){ string@s; bool neg=false; ll v=0; for(char c:s){ if(c=='-'){ neg=true; } if(c>='0'&&c<='9'){ v=v*10+(c-'0'); } } return neg?-v:v; } { ll a=get(),b=get(); ll afn,afa[64],afs[64]; afn=Factor(a,afa,afs); bool saw2=false,saw5=false; rep(i,afn){ ll x=afs[i]; if(afa[i]==2){ saw2=true; x-=4; } if(afa[i]==5){ saw5=true; x-=4; } x*=b; if(x<0){ wt("No"); exit(0); } if(x%1d4){ wt("No"); exit(0); } } if(!saw2||!saw5){ ll x=-4*b; if(x<0){ wt("No"); exit(0); } if(x%1d4){ wt("No"); exit(0); } } wt("Yes"); }