# coding=utf-8: lineA = input().split('.') lineB = input().split('.') for i, num in enumerate(lineA): lineA[i] = int(num) for j, num in enumerate(lineB): lineB[j] = int(num) c = 0 for a, b in zip(lineA, lineB): if a < b: print("NO") break elif a >= b: c += 1 if c == 3: print("YES") break else: continue