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