f=lambda :tuple(map(int,input().split("."))) print("YES" if f()>=f() else "NO")