#include <bits/stdc++.h>
int v[] = {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 (v[i] > N) break;
    if (N % v[i] == 0) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
