#include <bits/stdc++.h>
using namespace std;
int check(long long int t) {
  int r, c = 1;
  while (t != 0 && c == 1) {
    r = t % 10;
    if (r == 7 || r == 4) {
      c = 1;
    } else
      c = 0;
    t = t / 10;
  }
  return c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, c = 0;
  cin >> t;
  for (int i = 4; i <= t; ++i) {
    if (t % i == 0) {
      if (check(i) == 1) {
        c = 1;
        break;
      }
    }
  }
  if (c)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
