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