#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, x, c, y, m;
  cin >> n;
  for (int i = 1; i < n; i++) {
    if (n % i == 0) {
      c = 0;
      y = 0;
      m = i;
      while (m) {
        x = m % 10;
        m = m / 10;
        if (x == 4 || x == 7) c++;
        y++;
      }
      if (c == y) {
        cout << "YES\n";
        return 0;
      }
    }
  }
  c = 0;
  y = 0;
  while (n) {
    x = n % 10;
    n = n / 10;
    if (x == 4 || x == 7) c++;
    y++;
  }
  if (c == y)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
