# -*- coding: utf-8 -*- old = [int(i) for i in input().split(".")] judging = [int(i) for i in input().split(".")] result = "YES" for i in range(len(old)): if old[i] < judging[i]: result = "NO" break print(result)