#include <bits/stdc++.h>
using namespace std;
int n1;
int i, j;
int main() {
  int a[10] = {4, 7, 47, 74, 447, 474, 477, 774, 747, 744};
  string n;
  cin >> n;
  int z = n.length();
  stringstream stoi(n);
  stoi >> n1;
  for (i = 0; i < 10; i++) {
    if (n1 % a[i] == 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
