import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict, Counter import string import random input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') S1 = input()[:-1] S2 = input()[:-1] S3 = input()[:-1] T1 = '#.#' T2 = '.#.' if S1 == T1 and S2 == T2 and S3 == T1: print('Yes') elif S1 == T2 and S2 == T1 and S3 == T2: print('Yes') else: print('No')