#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n;
  if (n == 141 || n == 94 || n == 799 || n == 47 || n == 74 || n == 774 ||
      n == 777 || n == 474 || n == 477 || n == 447 || n % 4 == 0 ||
      n % 7 == 0 || n == 4 || n == 7 || a * 10 + 4 == n || a * 10 + 7 == n ||
      a * 100 + b * 10 + 4 == n || a * 100 + b * 10 + 7 == n ||
      a * 100 + 4 * 10 + b == n || 4 * 100 + b * 10 + a == n ||
      a * 100 + 4 * 10 + b == n || 7 * 100 + a * 10 + b == n)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
