#include <iostream>

int main(){
    int N;
    while(scanf("%d",&N)==1){
        int N2 = N*N;
        bool flag=false;
        while (N!=0&&N2!=0){
            //获取一个数字位
            int Nt = N%10;
            int N2t = N2%10;
            N  /= 10;
            N2 /= 10;
            if(Nt!=N2t){
                flag = true;
                break;
            }
        }
        if(flag) printf("No!\n");
        else printf("Yes!\n");
        
    }


    return 0;
}