#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[] = {4, 7, 44, 47, 74, 77, 444, 447, 477, 777, 744, 747, 474, 774};
  bool a = false;
  for (int i = 0; i < 14; i++) {
    if (n % arr[i] == 0) {
      a = true;
    }
  }
  if (a) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
