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

int main(){
   vector<int> s(4);
  cin>>s.at(0)>>s.at(1)>>s.at(2)>>s.at(3);
  sort(s.begin(),s.end());
  vector<int> ss={1,4,7,9};
  if (s==ss) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}