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