#include <bits/stdc++.h>
using namespace std;
int main() {
  int numb;
  string numbs;
  bool seven = false;
  cin >> numb;
  numbs = to_string(numb);
  for (int q = 0; q < numbs.length(); q++) {
    if (numbs[q] != '7' && numbs[q] != '4') {
      if (numb % 4 == 0 || numb % 7 == 0 || numb % 47 == 0 || numb % 74 == 0 ||
          numb % 444 == 0 || numb % 447 == 0 || numb % 474 == 0 ||
          numb % 744 == 0 || numb % 477 == 0 || numb % 774 == 0 ||
          numb % 777 == 0) {
        cout << "YES";
        return 0;
      } else {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
