#include #include using namespace std; using ll = long long; struct Edge { ll to; ll cost; }; using Graph = vector>; using P = pair; #define mp make_pair #define REP(i, n) for (int i = 0; i < (n); ++i) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) #define ALL(v) (v).begin(), v.end() ll MOD = 998244353; const ll nmax = 8; const ll INF = 1e10; const int MAX = 510000; bool graph[nmax][nmax]; long long fac[MAX], finv[MAX], inv[MAX]; void Case(int i) { printf("Case #%d: ", i); } void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } ll COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } vector> dist = vector>(nmax, vector(nmax, INF)); void warshall_floyd(ll n) { for (size_t i = 0; i < n; i++) { for (size_t j = 0; j < n; j++) { for (size_t k = 0; k < n; k++) { dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]); } } } } ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; } ll mulMod(ll a, ll b) { return (((a % MOD) * (b % MOD)) % MOD); } ll powMod(ll a, ll p) { if (p == 0) { return 1; } else if (p % 2 == 0) { ll half = powMod(a, p / 2); return mulMod(half, half); } else { return mulMod(powMod(a, p - 1), a); } } ll ceil(ll a, ll b) { return (a + b - 1) / b; } bool isPrime(ll N) { for (int i = 2; i * i <= N; i++) { if (N % i == 0) return false; } return true; } ll cntbit(ll i) { if (i == 0) return 0; ll ret = 0; i++; while (i != 0) { i = i >> 1; ret++; } return ret - 1; } ll getSize(ll a) { ll ret = 0; while (a != 0) { ret++; a /= 10; } return ret; } vector> prime_factorize(long long N) { vector> res; for (long long a = 2; a * a <= N; ++a) { if (N % a != 0) continue; long long ex = 0; while (N % a == 0) { ++ex; N /= a; } res.push_back({a, ex}); } if (N != 1) res.push_back({N, 1}); return res; } using mint = atcoder::modint998244353; vector dp; void dfs(Graph &G, int v, int p) { dp[v] = 1; for (auto &&i : G[v]) { if (i != p) { dfs(G, i, v); dp[v] += dp[i]; } } } int main() { ll N; cin >> N; bool ans = true; for (int i = 2; i * i <= N; i++) { if (N % i == 0) { ll cnt = 0; while (N % i == 0) { cnt++; N /= i; } if (cnt % 3 != 0) { ans = false; } } } if(ans){ cout << "Yes" << endl; }else{ cout << "No" << endl; } return 0; }