a=[] [gets,gets].each{|e|a+=e.scan(/([0-9])\.([0-9])\.([0-9])/)} a.map!{|e|e.map(&:to_i)} puts a[0][0]*10000+a[0][1]*100+a[0][2] >= a[1][0]*10000+a[1][1]*100+a[1][2] ? "YES" : "NO"