ll@T,p[2]={2,5};rep(T){ll@N,M=N*N+2;if(M!=3){ll c[2]={},f[2]={M+2*N,M-2*N};rep(i,2)rep(j,2)while(f[i]%p[j]<1)f[i]/=p[j],c[j]++;wtLn("No",min(c[0],c[1]));}else wtLn("Yes",0);}