#include <bits/stdc++.h>
int main() {
  int n, f, s;
  scanf("%d", &n);
  f = n % 4;
  s = n % 7;
  if (n == 7 || n == 4 || n == 47 || n == 74 || n == 444 || n == 447 ||
      n == 474 || n == 477 || n == 777 || n == 774 || n == 747 || n == 744 ||
      f == 0 || s == 0 || n % 47 == 0 || n % 74 == 0 || n % 444 == 0 ||
      n % 447 == 0 || n % 474 == 0 || n % 477 == 0) {
    printf("YES");
  } else {
    printf("NO");
  }
  return 0;
}
