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