a,b,c,d = gets.split(" ").map(&:to_i)

if (a == 1 or a == 9 or a == 7 or a == 4) and (b == 1 or b == 9 or b == 7 or b == 4) and (a != b) and (b != d) and (b != c) and (c == 1 or c == 9 or c == 7 or c == 4) and (a != c) and (d == 1 or d == 9 or d == 7 or d == 4) and (a != d) and (c != d)
  puts "YES"
else
  puts "NO"
end