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