#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using ll = long long; using ld = long double; using P = pair<int, int>; using Graph = vector<vector<ll>>; using vi = vector<int>; using vl = vector<long>; using vll = vector<long long>; using vvi = vector<vi>; using vvl = vector<vl>; using vvll = vector<vll>; using vs = vector<string>; using vc = vector<char>; using vvc = vector<vc>; using pll = pair<long long, long long>; using vpll = vector<pll>; using mint = modint1000000007; const long double EPS = 1e-18; const long long INF = 1e18; const long double PI = acos(-1.0L); #define reps(i, a, n) for (ll i = (a); i < (ll)(n); i++) #define rep(i, n) for (ll i = (0); i < (ll)(n); i++) #define rrep(i, n) for (ll i = (1); i < (ll)(n + 1); i++) #define repd(i, n) for (ll i = n - 1; i >= 0; i--) #define rrepd(i, n) for (ll i = n; i >= 1; i--) #define ALL(n) begin(n), end(n) #define IN(a, x, b) (a <= x && x < b) #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0); template <class T> inline T CHMAX(T& a, const T b) { return a = (a < b) ? b : a; } template <class T> inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; } int main() { string S; cin >> S; set<ll> se; rrep(i, 1e6) { se.insert((i * i) % 1000000); } if (se.count(stoll(S))) { cout << "YES" << endl; } else { cout << "NO" << endl; } }