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