#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int temp = n, x = 0;
  while (n > 0) {
    x = n % 10;
    if (x == 4 || x == 7) {
      n = n / 10;
    } else
      break;
  }
  if (n == 0)
    cout << "YES";
  else {
    if (temp % 4 == 0 || temp % 7 == 0 || temp % 74 == 0 || temp % 47 == 0)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
