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