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