#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 5;
const int MAX_DIST = 1e9 + 7;
vector<int> v[106];
map<int, int> ans;
bool visit[1000];
void dfs(int n) {
  for (int i = 0; i < v[n].size(); i++) {
    ans[v[n][i]]--;
    visit[v[n][i]] = true;
  }
}
bool lucky(long long x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i * i <= n; i++)
    if (n % i == 0)
      if (lucky(i) || lucky(n / i)) return puts("YES");
  puts("NO");
}
