#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 0;
  if (n == 7 || n == 4 || n % 4 == 0 || n % 7 == 0 || n % 47 == 0) {
    cout << "YES";
    return 0;
  }
  for (; n % 10 != 0 || n / 10 >= 1;) {
    if (n % 10 == 7) {
    } else if (n % 10 == 4) {
    } else {
      cout << "NO";
      return 0;
    }
    n = n / 10;
  }
  cout << "YES";
  return 0;
}
