#include <bits/stdc++.h>
using namespace std;
int inline in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long inline lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void P(long long x) { printf("%lld", x); }
void Pi(int x) { printf("%d", x); }
char tochar(int x) { return x + '0'; }
int toint(char x) { return x - '0'; }
long long fx[] = {0, 0, -1, 1, -1, -1, 1, 1};
long long fy[] = {-1, 1, 0, 0, -1, 1, -1, 1};
long long dx[] = {0, 0, -1, 1};
long long dy[] = {-1, 1, 0, 0};
long long n, m;
long long ncr[1010][10];
long long NCR(long long n, long long r) {
  if (n == r || r == 0) return ncr[n][r] = 1;
  if (r == 1) return ncr[n][r] = n;
  if (ncr[n][r] != -1) return ncr[n][r];
  return ncr[n][r] = NCR(n - 1, r) + NCR(n - 1, r - 1);
}
long long dar[1010];
long long DAR(long long n) {
  if (n == 0) return 1;
  if (dar[n] != -1) return dar[n];
  return n * DAR(n - 1) + (n % 2 ? -1 : 1);
}
long long a[1010];
char s[1010];
map<long long, long long> ma;
int main() {
  long long i, j, k, d;
  n = lin();
  bool ck = 0;
  for (i = 4; i <= n; i++) {
    long long d = i;
    if (n % d == 0) {
      bool ok = 1;
      while (d) {
        long long x = d % 10;
        d /= 10;
        if (!(x == 4 || x == 7)) {
          ok = 0;
          break;
        }
      }
      if (ok) {
        ck = 1;
        break;
      }
    }
  }
  if (ck)
    puts("YES");
  else
    puts("NO");
  return 0;
}
