#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, i;
  cin >> n;
  vector<int> a;
  a.push_back(n);
  for (i = 2; i * i < n; i++) {
    if (n % i == 0) {
      a.push_back(i);
      a.push_back(n / i);
    }
  }
  if (i * i == n) {
    a.push_back(i);
  }
  for (int i = 0; i < (int)a.size(); i++) {
    vector<int> num(10, 0);
    int m = a[i];
    while (m > 0) {
      num[m % 10]++;
      m /= 10;
    }
    int k = 0;
    for (int i = 0; i < 10; i++) {
      if (num[i] > 0) k++;
    }
    if ((num[4] > 0 && num[7] > 0 && k == 2) ||
        ((num[4] > 0 || num[7] > 0) && k == 1)) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
