a0,b0,c0 = map(int,input().split('.')) a1,b1,c1 = map(int,input().split('.')) ac,bc,cc = False,False,False if a0 - a1 >= 0: ac = True if b0 - b1 >= 0: bc = True if c0 - c1 >= 0: cc = True if ac and bc and cc: print('YES') else: print('NO')