#include 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; using tll=tuple; const ll INF=(1ll<<60); template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a> s; while(true){ auto now=chrono::system_clock::now(); auto msec=chrono::duration_cast(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++; } }