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