#include <bits/stdc++.h>
using namespace std;
long long p[1000007] = {0};
vector<long long> primes;
void seive() {
  long long n = 1000005;
  p[2] = 1;
  primes.push_back(2);
  for (long long i = 3; i <= n; i += 2) p[i] = 1;
  for (long long i = 3; i <= n; i++) {
    if (p[i]) {
      primes.push_back(i);
      for (long long j = i * i; j <= n; j += i) {
        p[j] = 0;
      }
    }
  }
}
vector<long long> prime_factor(long long n) {
  vector<long long> prime_factors;
  long long countDivisors = 0;
  long long cnt = 0;
  long long i = 0;
  long long p = primes[i];
  while (p * p <= n) {
    if (n % p == 0) {
      prime_factors.push_back(p);
      cnt = 0;
      while (n % p == 0) {
        cnt++;
        n = n / p;
      }
    }
    i++;
    p = primes[i];
  }
  if (n != 1) {
    prime_factors.push_back(n);
  }
  return prime_factors;
}
bool isPrime(long long n) {
  if (n <= 1000005) return p[n];
  for (long long i = 0; primes[i] * primes[i] <= n; i++) {
    if (n % primes[i] == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, b % a); }
long long fastPower(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b = b >> 1;
  }
  return ans;
}
long long power2(long long a, long long b) {
  long long ans = 1;
  while (b > 0)
    if (b & 1) ans = ((ans % 1000000007) * (a % 1000000007)) % 1000000007;
  a = ((a % 1000000007) * (a % 1000000007)) % 1000000007;
  b = (b >> 1);
  return ans;
}
bool comp(const pair<long long, long long> &a,
          const pair<long long, long long> &b) {
  return a.first < b.first;
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long arr[] = {4, 7, 47, 74, 444, 447, 474, 477, 744, 747, 774, 777};
  long long flag = 0;
  for (long long i = 0; i < 12; i++) {
    if (n % arr[i] == 0) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
