fossil = gets.chomp.split(".").join current = gets.chomp.split(".").join puts (fossil.to_i > current.to_i) ? "YES" : "NO"