#include <bits/stdc++.h>
using namespace std;
int verify(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return 0;
    x /= 10;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      if (verify(i)) {
        cout << "YES";
        return 0;
      }
      if (verify(n / i)) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
