#include <bits/stdc++.h>
int main() {
  int n, p = 0;
  std::cin >> n;
  int arr[12] = {4, 7, 44, 77, 47, 74, 444, 447, 477, 777, 744, 774};
  for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++) {
    if (n % arr[i] == 0) {
      p++;
      break;
    }
  }
  if (p == 1) {
    std::cout << "YES";
  } else {
    std::cout << "NO";
  }
  return 0;
}
