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