import sys readline=sys.stdin.readline S=[readline().rstrip() for i in range(3)] se=set() for i in range(3): for j in range(3): se.add((i+j+(S[i][j]=="#"))%2) if len(se)==1: ans="Yes" else: ans="No" print(ans)