#include <bits/stdc++.h>
using namespace std;

int main() {
    vector<int> a(4), b; b = {1, 4, 7, 9};
    for (int i = 0; i < 4; i++) cin >> a[i];
    sort(a.begin(), a.end());
    if (a == b) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}