#include <bits/stdc++.h>
using namespace std;
int n, a[1001], ans = 0;
bool h(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return false;
    x /= 10;
  }
  return true;
}
int main() {
  scanf("%d\n", &n);
  for (int i = 1; i <= 1000; i++)
    if (h(i)) a[++ans] = i;
  for (int i = 1; i <= ans; i++)
    if (n % a[i] == 0) {
      cout << "YES";
      exit(0);
    }
  cout << "NO";
  fclose(stdin);
  fclose(stdout);
  return 0;
}
