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] == s[2] and s[0] != s[1]: S2 = True if S and S2 == True: print('Yes') else: print('No')