#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, i, x, sum = 0;
  cin >> a;
  if (a % 4 == 0 || a % 7 == 0 || a % 47 == 0 || a % 74 == 0 || a % 444 == 0 ||
      a % 447 == 0 || a % 744 == 0 || a % 747 == 0 || a % 477 == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
