# -*- coding:utf-8 -*- if __name__ == '__main__': read_version =lambda : int("{:0>3}{:0>3}{:0>3}".format(*map(int, input().split(".")))) print("YES" if read_version() >= read_version() else "NO")