s1=list(map(int, input().split("."))) s2=list(map(int, input().split("."))) print("YES" if (s1[0]-s2[0])*10000+(s1[1]-s2[1])*100+(s1[2]-s2[2]) >= 0 else "NO")