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