Imports System

Module Program

	Public Function CountChar(ByVal s As String, ByVal c As Char) As Integer
		Return s.Length - s.Replace(c.ToString(), "").Length
	End Function

	Sub Main()

		Dim msg As String
		Dim s As String
		Dim parts As String()
		Dim cnt1, cnt2, cnt3, cnt4 As Integer

		s = Console.ReadLine()
		parts = Split(s, " ", -1, CompareMethod.Binary)


		s = ""

		For Each p As String In parts
			s += p
		Next

		cnt1 = CountChar(s, "1")
		cnt2 = CountChar(s, "9")
		cnt3 = CountChar(s, "7")
		cnt4 = CountChar(s, "4")

		If cnt1 = 1 And cnt2 = 1 And cnt2 = 1 And cnt4 = 1 Then
			msg = "YES"
		Else
			msg = "NO"
		End If

		Console.WriteLine(msg)
    End Sub
End Module
