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