#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int64_t a, b, t;
  int arr[15] = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777};
  cin >> a;
  for (int i = 0; i < 14; i++) {
    if (a % arr[i] == 0) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
