a = gets.split(" ").map!{|i| i.to_i}
n1 = 0
n2 = 0
n3 = 0
n4 = 0
4.times do |i|
  if a[i] == 1 then n1 += 1
  elsif a[i] == 7 then n2 += 1
  elsif a[i] == 9 then n3 += 1
  elsif a[i] == 4 then n4 += 1
  end
end
if n1 == 1 and n2 == 1 and n3 == 1 and n4 == 1 
  puts "YES"
else puts "NO"
end