#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  scanf("%d", &a);
  int x[14] = {4, 7, 44, 47, 77, 74, 744, 777, 747, 774, 444, 477, 447, 474}, i,
      b, c = 0;
  for (i = 0; i < 14; i++) {
    b = a % x[i];
    if (b == 0) {
      printf("YES");
      c++;
      break;
    }
  }
  if (c == 0) printf("NO");
  return 0;
}
