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