using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    public static void Main() {
        int[] s = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        Array.Sort(s);
        if (s[0] == 1 && s[1] == 4 && s[2] == 7 && s[3] == 9) {
            Console.WriteLine("YES");
        } else {
            Console.WriteLine("NO");
        }
    }
}