#include <bits/stdc++.h>
using namespace std;
int main() {
  int lucky[] = {4, 7, 47, 74, 447, 474, 477, 744, 747};
  int n;
  cin >> n;
  for (int i = 0; i < 9; i++) {
    if (n % lucky[i] == 0) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
