#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  int lucky[11] = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 777};
  bool l = false;
  for (int i = 0; i < 11; i++)
    if (n >= lucky[i] && n % lucky[i] == 0) l = true;
  if (l)
    std::cout << "YES";
  else
    std::cout << "NO";
  return 0;
}
