def main(): A0 = tuple(map(int, input().split('.'))) A1 = tuple(map(int, input().split('.'))) ans = 'YES' for i, j in zip(A0, A1): if i < j: ans = 'NO' print(ans) main()