n = gets.chomp.split(' ').map(&:to_i)
a = [0, 0, 0, 0]
4.times do |i|
  if n[i] == 1
    a[0] += 1
  elsif n[i] == 9
    a[1] += 1
  elsif n[i] == 7
    a[2] += 1
  elsif n[i] == 4
    a[3] += 1
  end
end

if a[0] == 1 && a[1] == 1 && a[2] == 1 && a[3] == 1
  puts "YES"
else
  puts "NO"
end
