process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
var array = lines[0];
var n1 = array.indexOf(1);
if (n1 !== -1) {
var n2 = array .indexOf(9);
 if (n2 !== -1){
 var n3 = array .indexOf(7);
  if (n3 !== -1){
 var n4 = array .indexOf(4);
 if (n4 !== -1){
console.log("YES");
} else {
console.log("NO");
}
} else {
console.log("NO");
}

} else {
console.log("NO");
}

} else {
console.log("NO");
}

});