def xor(lst1, lst2): tmp = sum([x ^ y for x, y in zip(lst1, lst2)]) return True if tmp == 3 else False S = [''] * 3 S[0] = input().strip() S[1] = input().strip() S[2] = input().strip() for i in range(3): S[i] = S[i].replace('#', '0').replace('.', '1') S[i] = [int(j) for j in list(S[i])] print(['No', 'Yes'][xor(S[0], S[1]) and xor(S[1], S[2])])