#include <bits/stdc++.h>
using ll = long long;
using namespace std;
bool ch(int x) {
  string s = to_string(x);
  for (int i = 0; i < s.size(); i++)
    if (s[i] != '4' && s[i] != '7') return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> h;
  bool f = false;
  for (int i = 4; i <= n; i++)
    if (ch(i))
      if (n % i == 0) {
        f = true;
        break;
      }
  cout << (!f ? "NO" : "YES");
}
