#include <bits/stdc++.h>
using namespace std;
ofstream fo("output.txt");
ifstream fi("input.txt");
int n;
bool check(int i) {
  while (i > 0) {
    if (i % 10 != 4 && i % 10 != 7) return false;
    i = i / 10;
  }
  return true;
}
int main() {
  bool kt = false;
  int n;
  cin >> n;
  for (int i = 1; i < 1000; i++) {
    if (check(i)) {
      if (n % i == 0) kt = true;
    }
  }
  if (kt)
    cout << "YES";
  else
    cout << "NO";
  cout << "\n";
  return 0;
}
