#include<stdio.h>
int main(){
int n,p,ni,pi;
while(scanf("%d",&n)!=EOF){
p=n*n;
bool c=true;
while(n>0){
ni=n%10;
pi=p%10;
n=n/10;
p=p/10;
if(ni!=pi){
printf("No!\n");
c=false;
break;
}
}
if(c==true){
printf("Yes!\n");
}
}
return 0;
}
int main(){
int n,p,ni,pi;
while(scanf("%d",&n)!=EOF){
p=n*n;
bool c=true;
while(n>0){
ni=n%10;
pi=p%10;
n=n/10;
p=p/10;
if(ni!=pi){
printf("No!\n");
c=false;
break;
}
}
if(c==true){
printf("Yes!\n");
}
}
return 0;
}