#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  int a[8] = {4, 7, 47, 74, 477, 447, 774, 747};
  for (int i = 0; i < 8; i++) {
    if (n == a[i] || n % a[i] == 0) cnt++;
  }
  if (cnt)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
