#include <bits/stdc++.h>
int main() {
  int n, i, x, c = 0;
  scanf("%d", &n);
  x = n;
  while (x > 0) {
    if (x % 10 != 4 && x % 10 != 7) {
      c++;
    }
    x = x / 10;
  }
  if (c == 0) {
    printf("YES\n");
  } else {
    if (n % 4 == 0 || n % 7 == 0 || n % 47 == 0 || n % 44 == 0 || n % 77 == 0 ||
        n % 74 == 0 || n % 444 == 0 || n % 447 == 0 || n % 477 == 0 ||
        n % 474 == 0 || n % 777 == 0 || n % 774 == 0 || n % 744 == 0 ||
        n % 747 == 0) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
