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