#include <bits/stdc++.h>
using namespace std;
const long long INFLL = 1e18;
int main() {
  int v[1020] = {};
  for (int i = 0; i < 1020; i++) v[i] = 1;
  v[4] = 0;
  v[7] = 0;
  v[44] = 0;
  v[47] = 0;
  v[74] = 0;
  v[77] = 0;
  v[444] = 0;
  v[447] = 0;
  v[474] = 0;
  v[477] = 0;
  v[744] = 0;
  v[747] = 0;
  v[774] = 0;
  v[777] = 0;
  for (int i = 1; i < 1001; i++) {
    for (int j = 1; j < 502 and j * i <= 1000; j++) {
      if (v[i * j] != 0) v[i * j] = v[i] * v[j];
    }
  }
  int n;
  cin >> n;
  if (!v[n])
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
