S1=input() S2=input() S3=input() if S2[-1]=="#": temp="."+S2[0:len(S2)-1] else: temp="#"+S2[0:len(S2)-1] if S1==temp and S3==temp: print("Yes") else: print("No")