#include <bits/stdc++.h>
const int N = 1e5 + 5;
using namespace std;
template <class T>
inline bool read(T &ret) {
  char c;
  int sgn;
  if (static_cast<void>(c = getchar()), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (static_cast<void>(c = getchar()), c >= '0' && c <= '9')
    ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
bool jude(int cur) {
  while (cur) {
    int x = cur % 10;
    if (x != 4 && x != 7) return false;
    cur /= 10;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  bool flag = false;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      if (jude(i) || jude(n / i)) flag = true;
    }
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
