#include <bits/stdc++.h>
bool checkLucky(int x) {
  int t = x;
  while (t > 0) {
    int a = t % 10;
    t = t / 10;
    if (a != 4 && a != 7) {
      return false;
    }
  }
  return true;
}
int main() {
  int n, i, x = -1;
  scanf("%d", &n);
  for (i = 4; i <= n; i++) {
    if (n % i == 0) {
      if (checkLucky(i)) {
        x = 0;
        break;
      }
    }
  }
  if (x == 0) {
    printf("YES");
  } else {
    printf("NO");
  }
}
