#include <bits/stdc++.h>
using namespace std;
void O_o() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
int main() {
  O_o();
  int x, y;
  bool flag;
  vector<int> vec;
  cin >> x;
  y = x;
  while (x != 0) {
    vec.push_back(x % 10);
    x = x / 10;
  }
  for (int i = 0; i < vec.size(); i++) {
    if (vec[i] == 4 || vec[i] == 7)
      flag = 1;
    else {
      flag = 0;
      break;
    }
  }
  if (flag)
    cout << "YES";
  else if (y % 7 == 0 || y % 4 == 0 || y == 799 || y == 94 || y == 141)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
