#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const int N = 1000005;
int main() {
  int n;
  int arr[12] = {4, 7, 47, 74, 444, 447, 474, 477, 744, 747, 774, 777};
  cin >> n;
  for (int i = 0; i < 9; i++) {
    if (n % arr[i] == 0) {
      cout << "YES" << '\n';
      exit(0);
    }
  }
  cout << "NO" << '\n';
}
