#include <iostream>
using namespace std;

int main() {
    int a, b, tmp;
    while (cin >> a) { // 注意 while 处理多个 case
        b = a * a;
        tmp = 0;
        for(int base = 1; tmp < a; base *= 10, b /= 10) {
            tmp += base * (b % 10);
        }
        cout << (a == tmp ? "Yes!" : "No!") << endl;
    }
}
// 64 位输出请用 printf("%lld")