#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
int n;
int i = 0;
cin >> n;
for(i = 1; i <= n; ++i) {
if(n % i == 0) {
bool ok = true;
int t = i;
while(t) {
if(t%10 != 4 && t%10 != 7) {
ok = false;
break;
}
t /= 10;
}
if(ok) break;
}
}
cout << (i > n ? "NO" : "YES") << endl;
return 0;
}