#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
std::vector<int> divisors;
void findDivisors(int n) {
  for (int i = 1; i <= n; i++)
    if (n % i == 0) divisors.push_back(i);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  findDivisors(n);
  string ans;
  for (int i = 0; i < divisors.size(); ++i) {
    if (divisors[i] % 4 == 0 || divisors[i] % 7 == 0) {
      ans = "YES";
      break;
    } else {
      int div = divisors[i];
      while (div != 0) {
        int temp = div % 10;
        div /= 10;
        if (temp == 4 || temp == 7) {
          ans = "YES";
        } else {
          ans = "NO";
          break;
        }
      }
    }
    if (ans == "YES") break;
  }
  cout << ans;
  return 0;
}
