#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(long long)(n);i++)
#define all(v) v.begin(),v.end()
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
const ll INF=(1ll<<60);
template<class T> void chmin(T &a,T b){
    if(a>b){
        a=b;
    }
}
template<class T> void chmax(T &a,T b){
    if(a<b){
        a=b;
    }
}
int main(){
    auto start=chrono::system_clock::now();
    ll i=1000;
    string s;
    cin >> s;
    while(true){
        auto now=chrono::system_clock::now();
        auto msec=chrono::duration_cast<chrono::milliseconds>(now-start).count();
        if(1980<=msec){
            cout << "NO" << endl;
            return 0;
        }
        string t=to_string(i*i);
        if(t.substr(t.size()-6,6)==s){
            cout << "YES" << endl;
            return 0;
        }
        i++;
    }
}