#include <bits/stdc++.h>
using namespace std;
int lucky(int n) {
  int k = n;
  while (k > 0) {
    if (k % 10 != 4 && k % 10 != 7) {
      return 0;
    }
    k = k / 10;
  }
  return n;
}
int length(int *x, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (x[i] == 0) {
      return i - 1;
    }
  }
  return n;
}
void almostlucky(int n) {
  int i, x[n], k, count = 0;
  for (i = 0; i < n; i++) {
    x[i] = 0;
  }
  for (i = 1; i <= n; i++) {
    k = lucky(i);
    if (k != 0) {
      x[count] = k;
      count++;
    }
  }
  for (i = 0; i <= length(x, n); i++) {
    if (n % x[i] == 0) {
      cout << "YES";
      return;
    }
  }
  cout << "NO";
  return;
}
int main() {
  int n;
  cin >> n;
  almostlucky(n);
  return 0;
}
