s1 = input() s2 = input() s3 = input() if s1[0] == s1[1] or s1[1] == s1[2]: print("No") exit() for a, b, c in zip(list(s1), list(s2), list(s3)): if a == b or b == c: print("No") exit() print("Yes")