A = '#.#.#.#.#' B = '.#.#.#.#.' S = input() + input() + input() if S == A or S == B: print('Yes') else: print('No')