A, B, C = map(int, input().split('.')) a, b, c = map(int, input().split('.')) if (a, b, c) <= (A, B, C): print("YES") else: print("NO")