# 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: print("YES") break else: continue