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