#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class Q>
void clearQueue(Q& q) {
  q = Q();
}
bool islucky(long long a) {
  while (a > 0) {
    long long d = a % 10;
    if (d != 4 && d != 7) return false;
    a /= 10;
  }
  return true;
}
void solve() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    if (n % i == 0 && islucky(i)) {
      cout << "YES";
      return;
    }
  }
  cout << "NO";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
