unittest
{
	assert( [ "1 7 9 4" ].parse.expand.solve == "YES" );
	assert( [ "1 9 7 4" ].parse.expand.solve == "YES" );
	assert( [ "1 2 9 1" ].parse.expand.solve == "NO" );
	assert( [ "4 9 0 8" ].parse.expand.solve == "NO" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto ns = input.front.split.to!( long[] );
	return tuple( ns );
}

auto solve( long[] ns )
{
	ns.sort();
	return ( ns.equal( [ 1L, 4L, 7L, 9L ] ) ) ? "YES" : "NO";
}
