#include <bits/stdc++.h>
using namespace std;
int judg(int n) {
  int sum = 1;
  for (;;) {
    if (n / 10 == 0) {
      if ((n == 4) || (n == 7)) return 1;
    }
    int wei;
    wei = n % 10;
    n = n / 10;
    if ((wei != 4) && (wei != 7)) return 0;
  }
}
int jugd2(int n) {
  if (n % 44 == 0) return 1;
  if (n % 77 == 0) return 1;
  if (n % 47 == 0) return 1;
  if (n % 74 == 0) return 1;
  if (n % 444 == 0) return 1;
  if (n % 777 == 0) return 1;
  if (n % 474 == 0) return 1;
  if (n % 744 == 0) return 1;
  if (n % 447 == 0) return 1;
  if (n % 747 == 0) return 1;
  if (n % 477 == 0) return 1;
  if (n % 774 == 0) return 1;
  return 0;
}
int main() {
  int n;
  for (; cin >> n;) {
    int key = judg(n);
    if (key == 1) {
      cout << "YES" << endl;
      continue;
    } else {
      if ((n % 4 == 0) || (n % 7 == 0) || jugd2(n))
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
