#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  cin >> x;
  if (x == 0) {
    cout << "NO" << endl;
  } else {
    if ((x % 4 == 0) || (x % 7 == 0) || (x % 47 == 0) || (x % 74 == 0) ||
        (x == 894) || (x == 948) || (x == 954) || (x == 47) || (x == 74) ||
        (x == 447) || (x == 474) || (x == 477) || (x == 747)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
