"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf8");

var reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on("line", line => {
  let arr = [1, 4, 7, 9];
  let n = line
    .split(/\s/)
    .map(x => parseInt(x))
    .sort((a, b) => a - b);

  let ans = true;
  for (let i = 0; i < arr.length; i++) {
    if (arr[i] != n[i]) {
      ans = false;
      break;
    }
  }
  if (ans) console.log("YES");
  else console.log("NO");
});
