#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define INF 1001001001
#define MOD 1000000007
using ll = long long;
using vi = vector<int>;

int main() {
    int a;
    cin >> a;
    bool yes = false;
    for (ll i = 0; i < 1000000; i++) {
        ll x = i*i;
        if (x % 1000000 == a) {
            // cout << i << endl;
            yes = true;
        }
    }
    if (yes) cout << "YES" << endl;
    else cout << "NO" << endl;

}