#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int b[12];
  b[0] = 4;
  b[1] = 7;
  b[2] = 47;
  b[3] = 74;
  b[4] = 444;
  b[5] = 447;
  b[6] = 474;
  b[7] = 477;
  b[8] = 744;
  b[9] = 747;
  b[10] = 774;
  b[11] = 777;
  for (int i = 0; i < 12; i++) {
    if (n % b[i] == 0) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
