s1 = input() s2 = input() s3 = input() if s1[0] and s3[0] == s1[2] and s3[2]: S = True if s2 != s1 and s2[0] == s2[2] and s2[0] != s2[1]: SS = True if S and SS == True: print('Yes') else: print('No')