s,t=2.times.map{gets.split(?.).map(&:to_i)} puts (s<=>t) == -1 ? "NO" : "YES"