"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = arg[0].split(" ").map(n=>~~n);
    
    console.log(~~N.sort((a,b)=>a-b).join("") === 1479 ? "YES" : "NO");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
