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