n = gets.split.map(&:to_i)
for i in 0..3
  if n[i] == 1
    break
  end
  if i == 3
    puts "NO"
    exit
  end
end
for i in 0..3
  if n[i] == 9
    break
  end
  if i == 3
    puts "NO"
    exit
  end
end
for i in 0..3
  if n[i] == 7
    break
  end
  if i == 3
    puts "NO"
    exit
  end
end
for i in 0..3
  if n[i] == 4
    break
  end
  if i == 3
    puts "NO"
    exit
  end
end
puts "YES"
