#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, i;
  cin >> n;
  string s;
  int *arr = new int[14];
  arr[0] = 4;
  arr[1] = 7;
  arr[2] = 44;
  arr[3] = 47;
  arr[4] = 74;
  arr[5] = 77;
  arr[6] = 444;
  arr[7] = 447;
  arr[8] = 474;
  arr[9] = 477;
  arr[10] = 744;
  arr[11] = 747;
  arr[12] = 774;
  arr[13] = 777;
  s = n;
  l = s.length();
  for (i = 0; i < 14; i++) {
    if (n < arr[i]) {
      cout << "NO";
      return 0;
    }
    if (n % arr[i] == 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
