#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 1, 1, 0, -1, -1}, dy[] = {-1, -1, -1, 0, 1, 1, 1, 0};
template <class T>
int len(const T& c) {
  return (int)c.size();
}
long long stoi(string s) {
  long long n = 0;
  for (__typeof(len(s)) i = 0; i < (len(s)); i++)
    n = (n << 3) + (n << 1) + (s[i] - 48);
  return n;
}
string itos(long long n) {
  if (n == 0) return "0";
  string s;
  while (n) {
    s += (n % 10 + 48);
    n /= 10;
  }
  reverse((s).begin(), (s).end());
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  long a[15] = {4, 7, 44, 77, 47, 74, 444, 447, 474, 744, 777, 774, 747, 477};
  long k;
  while (cin >> k) {
    for (__typeof(14) i = 0; i < (14); i++) {
      if (k % a[i] == 0) {
        cout << "YES" << endl;
        return 0;
      }
    }
    cout << "NO" << endl;
  }
  return 0;
}
