#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU (A2,B2,C2),(A1,B1,C1) = readlines.map{|x| x.split('.').map(&:to_i)} f = ((A1 > A2) || ((A1 == A2) && ((B1 > B2) || ((B1 == B2) && (C1 > C2))))) puts f ? 'NO' : 'YES'