#include <bits/stdc++.h>
int a[1001];
int islucky(int x) {
  while (x > 0) {
    if (x % 10 != 4 && x % 10 != 7) return 0;
    x /= 10;
  }
  return 1;
}
void init() {
  int i, j;
  for (i = 0; i < 1001; i++) a[i] = 0;
  for (i = 1; i < 1001; i++) {
    a[i] = islucky(i);
    if (a[i] == 1) continue;
    for (j = 1; j < i; j++)
      if (a[j] == 1 && i % j == 0) {
        a[i] = 1;
        break;
      }
  }
}
int main() {
  int n;
  init();
  while (scanf("%d", &n) != EOF) {
    if (a[n] == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
