s1 = input() s2 = input() s3 = input() for i,v in enumerate(s1): if i == 0: continue if s1[i-1] == v: print("No") exit() for i,v in enumerate(s2): if i == 0: continue if s2[i-1] == v: print("No") exit() for i,v in enumerate(s3): if i == 0: continue if s3[i-1] == v: print("No") exit() for i in range(3): if s1[i] == s2[i] or s2[i] == s3[i]: print("No") exit() print("Yes")