import sys import numpy as np def main(): a = np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(-1, 4)[:, :3] == b'#' b = np.array([ [0, 1, 0], [1, 0, 1], [0, 1, 0] ], np.bool_) print('Yes' if np.array_equal(a, b) or np.array_equal(~a, b) else 'No') if __name__ == '__main__': main()