# -*- coding: utf-8 -*- A = map(int, raw_input().split(".")) X = map(int, raw_input().split(".")) assert all(0 <= x <= 100 for x in A) assert all(0 <= x <= 100 for x in X) print "YES" if A >= X else "NO"