import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	auto a = read.to!long;
	auto b = read.to!long;
	auto c = read.to!long;
	auto d = read.to!long;
	
	bool[] xs = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
	
	xs[a] = 1;
	xs[b] = 1;
	xs[c] = 1;
	xs[d] = 1;
	
	if(xs[1] + xs[9] + xs[7] + xs[4] == 4) "YES".writeln;
	else "NO".writeln;
}
