#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, c1 = 0;
  string str = "";
  cin >> n;
  for (int i = 4; i <= n; i++) {
    if (n % i == 0) {
      str = to_string(i);
      for (int j = 0; str[j] == '4' || str[j] == '7' && j < str.length(); j++) {
        c1++;
      }
      if (c1 == str.length()) {
        cout << "YES";
        c++;
        break;
      }
    }
  }
  if (c != 1) cout << "NO";
  return 0;
}
