#include <bits/stdc++.h>
using namespace std;
bool isLucky(int n) {
  string s = to_string(n);
  for (int i = 0; i < s.size(); i++) {
    if ((s[i] != '4') && (s[i] != '7')) return false;
  }
  return true;
}
int main() {
  int n, i = 1;
  cin >> n;
  for (int i = 1; i < n + 1; i++) {
    if (n % i == 0) {
      if (isLucky(i)) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
}
