zero = gets.chomp.split(".") one = gets.chomp.split(".") fossil = "YES" for i in 0..2 if(zero[i] < one[i]) fossil = "NO" break end end puts fossil