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