#include <bits/stdc++.h>
using namespace std;
int n, t, f, s, x;
int main() {
  cin >> n;
  for (int i = n; i >= 4; i--) {
    x = i;
    while (x > 0) {
      t = x % 10;
      if (t != 4 && t != 7) {
        f = 1;
        break;
      }
      x /= 10;
    }
    if (f == 0 && n % i == 0) {
      s = 1;
      break;
    }
    f = 0;
  }
  if (s == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
