#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int n;
  int lucky[13] = {4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 777};
  scanf("%d", &n);
  for (int i = 0; i < 13; i++)
    if (!(n % lucky[i])) {
      puts("YES");
      return 0;
    }
  puts("NO");
  return true;
}
int main() { solve(); }
