#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = n / 100; // 百位
int b = n / 10 % 10; // 十位
int c = n % 10; // 个位
int sum = a*a*a + b*b*b + c*c*c;
if (sum == n)
cout << "YES";
else
cout << "NO";
return 0;
}
int main() {
int a, b, c, d;
cin >> a;
b = a / 100;
c = (a / 100 - a % 10) / 10;
d = a % 10;
if (b * b * b + c * c * c + d * d * d == a) {
cout << "YES";
} else {
cout << "NO";
}
return 0;
}