def main(): a = tuple(map(int, input().split('.'))) b = tuple(map(int, input().split('.'))) print("YES" if a >= b else "NO") if __name__ == '__main__': main()