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