#include <bits/stdc++.h>
using namespace std;
int arr[14] = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777};
int isLucky(int n) {
  int x;
  while (n != 0) {
    x = n % 10;
    if (x == 7 || x == 4) {
      n = n / 10;
    } else {
      return 0;
    }
  }
  if (n == 0) {
    return 1;
  }
}
int isDiv(float n) {
  float x;
  if (isLucky(n)) {
    cout << "YES" << endl;
    return 0;
  } else {
    for (int i = 0; i < 14; i++) {
      if (arr[i] > n) {
        cout << "NO" << endl;
        return 0;
      }
      x = n / arr[i];
      if ((fmod(x, 2) == 0 || fmod(x, 2) == 1)) {
        cout << "YES" << endl;
        return 0;
      }
    }
    cout << "NO" << endl;
    return 0;
  }
}
int main() {
  int n;
  cin >> n;
  isDiv(n);
  return 0;
}
