A0,B0,C0=map(int,input().split(".")) A1,B1,C1=map(int,input().split(".")) std=A0*1000000+B0*1000+C0 give=A1*1000000+B1*1000+C1 if std>=give: print("YES") else: print("NO")