#include <cstdio>
using namespace std;
int a[11];
int main() {
a[0] = 1; //a[0]也要算进去!
a[1] = 1;
for (int i = 2; i < 11; i++)
a[i] = a[i - 1] * i;
int n;
while (scanf("%d", &n) != EOF) {
int t = n;
for (int i = 10; i >= 0; i--) {//n!每两个数相隔大 故可此方法
if (t >= a[i]) {
t -= a[i];
}
}
if (t > 0) {
printf("NO\n");
} else {
printf("YES\n");
}
}
}

京公网安备 11010502036488号