#include <bits/stdc++.h>
int tab[14] = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777};
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 14; i++) {
    if (n % tab[i] == 0) {
      printf("YES");
      return 0;
    }
  }
  printf("NO");
  return 0;
}
