In the city of Ultima Thule job applicants are often offered an IQ test. 

The test is as follows: the person gets a piece of squared paper with a 4 × 4 square painted on it. Some of the square's cells are painted black and others are painted white. Your task is to repaint at most one cell the other color so that the picture has a 2 × 2 square, completely consisting of cells of the same color. If the initial picture already has such a square, the person should just say so and the test will be completed. 

Your task is to write a program that determines whether it is possible to pass the test. You cannot pass the test if either repainting any cell or no action doesn't result in a 2 × 2 square, consisting of cells of the same color.


-----Input-----

Four lines contain four characters each: the j-th character of the i-th line equals "." if the cell in the i-th row and the j-th column of the square is painted white, and "#", if the cell is black.


-----Output-----

Print "YES" (without the quotes), if the test can be passed and "NO" (without the quotes) otherwise.


-----Examples-----
Input
####
.#..
####
....

Output
YES

Input
####
....
####
....

Output
NO



-----Note-----

In the first test sample it is enough to repaint the first cell in the second row. After such repainting the required 2 × 2 square is on the intersection of the 1-st and 2-nd row with the 1-st and 2-nd column.

Difficulty: EASY

Solutions:
from sys import stdin, stdout
import sys
INF = 100000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
from collections import defaultdict
import math
arr = []
for i in range(4):
	arr.append(get_string())
f = 0
for i in range(3):
	for j in range(3):
		(b, w) = (0, 0)
		for x in range(i, i + 2):
			for y in range(j, j + 2):
				if arr[x][y] == '#':
					b += 1
				else:
					w += 1
		if b == 3 and w == 1 or (b == 1 and w == 3) or b == 4 or (w == 4):
			print('YES')
			f = 1
			break
	if f == 1:
		break
if f == 0:
	print('NO')


def amount(a, u, d, l, r):
	k = 0
	for i in range(u, d):
		for j in range(l, r):
			if a[i][j] == '#':
				k += 1
	return k
a = []
for i in range(4):
	s = list(input())
	a.append(s)
for i in range(1, 3):
	for j in range(1, 3):
		u_l = amount(a, i - 1, i + 1, j - 1, j + 1)
		u_r = amount(a, i - 1, i + 1, j, j + 2)
		d_l = amount(a, i, i + 2, j - 1, j + 1)
		d_r = amount(a, i, i + 2, j, j + 2)
		if u_l == 0 or u_l == 1 or u_l == 3 or (u_l == 4) or (u_r == 0) or (u_r == 1) or (u_r == 3) or (u_r == 4) or (d_l == 0) or (d_l == 1) or (d_l == 3) or (d_l == 4) or (d_r == 0) or (d_r == 1) or (d_r == 3) or (d_r == 4):
			print('YES')
			exit()
print('NO')


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
a = []
for _ in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		r = 0
		if a[i][j] == a[i][j + 1]:
			r += 1
		if a[i][j] == a[i + 1][j + 1]:
			r += 1
		if a[i][j] == a[i + 1][j]:
			r += 1
		if r > 1 or r == 0:
			print('YES')
			exit()
print('NO')


from sys import stdin, stdout
x = [[i for i in stdin.readline()] for i in range(4)]
z = 'NO'
for i in range(3):
	for j in range(3):
		f = x[i][j] + x[i][j + 1] + x[i + 1][j] + x[i + 1][j + 1]
		if f.count('#') >= 3 or f.count('.') >= 3:
			z = 'YES'
			break
stdout.write(z)


l = []
for i in range(4):
	l.append(list(input()))
f = 0
for i in range(3):
	for j in range(3):
		c = 1
		x = l[i][j]
		if l[i][j + 1] == x:
			c += 1
		if l[i + 1][j] == x:
			c += 1
		if l[i + 1][j + 1] == x:
			c += 1
		if c == 3 or c == 1 or c == 4:
			f = 1
			break
	if f == 1:
		break
if f == 0:
	print('NO')
else:
	print('YES')


s = []
for i in range(4):
	s.append(input())
for i in range(3):
	for j in range(3):
		t = [s[i][j], s[i][j + 1], s[i + 1][j], s[i + 1][j + 1]]
		if t.count('#') > 2 or t.count('.') > 2:
			print('YES')
			exit(0)
print('NO')


s = []
for i in range(4):
	s.append(input())
for i in range(3):
	for j in range(3):
		if (s[i][j] == '.') + (s[i][j + 1] == '.') + (s[i + 1][j] == '.') + (s[i + 1][j + 1] == '.') != 2:
			print('YES')
			return
print('NO')


l = []
g = 0
for i in range(4):
	t = input()
	l.append(t)
for i in range(3):
	p = l[i]
	for j in range(3):
		a = l[i][j]
		b = l[i][j + 1]
		c = l[i + 1][j]
		d = l[i + 1][j + 1]
		if a == b or a == c:
			if a == b:
				if a == d:
					g = 1
					print('YES')
					break
			elif a == d:
				g = 1
				print('YES')
				break
		elif b == c and c == d:
			g = 1
			print('YES')
			break
	if g == 1:
		break
if g == 0:
	print('NO')


matrix = [list(input()) for _ in range(4)]
for i in range(3):
	flag = 0
	for j in range(3):
		temp = 0
		temp += 1 if matrix[i][j] == '#' else 0
		temp += 1 if matrix[i + 1][j] == '#' else 0
		temp += 1 if matrix[i][j + 1] == '#' else 0
		temp += 1 if matrix[i + 1][j + 1] == '#' else 0
		if temp >= 3:
			print('YES')
			flag = 1
			break
		temp = 0
		temp += 1 if matrix[i][j] == '.' else 0
		temp += 1 if matrix[i + 1][j] == '.' else 0
		temp += 1 if matrix[i][j + 1] == '.' else 0
		temp += 1 if matrix[i + 1][j + 1] == '.' else 0
		if temp >= 3:
			print('YES')
			flag = 1
			break
	if flag:
		break
else:
	print('NO')


b = False
s = []
for i in range(0, 4):
	st = str(input())
	s.append(st)
for i in range(0, len(s) - 1):
	for j in range(0, len(s[i]) - 1):
		x = 0
		if s[i][j] == '#':
			x += 1
		if s[i + 1][j] == '#':
			x += 1
		if s[i][j + 1] == '#':
			x += 1
		if s[i + 1][j + 1] == '#':
			x += 1
		if x != 2:
			print('YES')
			b = True
			break
	if b == True:
		break
if b == False:
	print('NO')


a = []
for i in range(4):
	s = input()
	b = []
	b[:0] = s
	a.append(b)
c = 0
for i in range(3):
	if c == 1:
		break
	for j in range(3):
		b = 0
		if a[i][j] == '#':
			b += 1
		if a[i + 1][j] == '#':
			b += 1
		if a[i][j + 1] == '#':
			b += 1
		if a[i + 1][j + 1] == '#':
			b += 1
		if b == 3 or b == 1 or b == 0 or (b == 4):
			print('YES')
			c = 1
			break
if c == 0:
	print('NO')


flag = False
n = [input(), input(), input(), input()]
for i in range(1, 4):
	for j in range(1, 4):
		if n[i][j] == n[i][j - 1]:
			if n[i - 1][j] == n[i][j] or n[i - 1][j - 1] == n[i][j]:
				flag = True
				break
	if flag:
		break
if flag:
	print('YES')
else:
	print('NO')


def main():
	from sys import stdin, stdout, stderr
	tb = [list(line[:-1]) for line in stdin]
	tb = [[[tb[line][i:i + 2], tb[lineb][i:i + 2]] for i in range(0, 3)] for (line, lineb) in zip(range(4), range(1, 4))]
	for frame in tb:
		for subframe in frame:
			cnta = sum(map(lambda x: x.count('.'), subframe))
			cntb = sum(map(lambda x: x.count('#'), subframe))
			if cnta == 1 or cnta == 0 or cntb == 1 or (cntb == 0):
				stdout.write('YES\n')
				return
	stdout.write('NO\n')
main()


a = []
res = 1
k = 0
for i in range(4):
	a.append(list(input()))
for i in range(3):
	for j in range(3):
		if a[i][j] == a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
			print('YES')
			res = 0
			k = 1
			break
	if k == 1:
		break
if k != 1:
	for i in range(3):
		for j in range(3):
			if a[i][j] == '#':
				a[i][j] = '.'
			else:
				a[i][j] = '#'
			if a[i][j] == a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
				print('YES')
				res = 0
				k = 1
				break
			if a[i][j] == '#':
				a[i][j] = '.'
			else:
				a[i][j] = '#'
			if k == 1:
				break
			if a[i][j + 1] == '#':
				a[i][j + 1] = '.'
			else:
				a[i][j + 1] = '#'
			if a[i][j] == a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
				print('YES')
				res = 0
				k = 1
				break
			if a[i][j + 1] == '#':
				a[i][j + 1] = '.'
			else:
				a[i][j + 1] = '#'
			if k == 1:
				break
			if a[i + 1][j] == '#':
				a[i + 1][j] = '.'
			else:
				a[i + 1][j] = '#'
			if a[i][j] == a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
				print('YES')
				res = 0
				k = 1
				break
			if a[i + 1][j] == '#':
				a[i + 1][j] = '.'
			else:
				a[i + 1][j] = '#'
			if k == 1:
				break
			if a[i + 1][j + 1] == '#':
				a[i + 1][j + 1] = '.'
			else:
				a[i + 1][j + 1] = '#'
			if a[i][j] == a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
				print('YES')
				res = 0
				k = 1
				break
			if a[i + 1][j + 1] == '#':
				a[i + 1][j + 1] = '.'
			else:
				a[i + 1][j + 1] = '#'
			if k == 1:
				break
		if k == 1:
			break
if res == 1:
	print('NO')


a = [[int('0') for i in range(4)] for j in range(4)]
for i in range(4):
	s = input()
	for j in range(4):
		a[i][j] = s[j]
flag = 0
for i in range(3):
	for j in range(3):
		if a[i][j] == a[i + 1][j] and a[i + 1][j] == a[i + 1][j + 1]:
			print('YES')
			flag = 1
			break
		if a[i][j] == a[i][j + 1] and a[i][j + 1] == a[i + 1][j + 1]:
			print('YES')
			flag = 1
			break
		if a[i][j] == a[i + 1][j] and a[i + 1][j] == a[i][j + 1]:
			print('YES')
			flag = 1
			break
	if flag == 1:
		break
if flag == 0:
	if a[3][0] == a[3][1] and a[3][1] == a[2][1]:
		print('YES')
	elif a[3][1] == a[3][2] and a[3][2] == a[2][2]:
		print('YES')
	elif a[3][2] == a[3][3] and a[3][3] == a[2][3]:
		print('YES')
	elif a[0][3] == a[1][3] and a[1][3] == a[1][2]:
		print('YES')
	elif a[1][3] == a[2][3] and a[2][3] == a[2][2]:
		print('YES')
	elif a[2][3] == a[3][3] and a[3][3] == a[3][2]:
		print('YES')
	else:
		print('NO')


def counter(y):
	x = 0
	for k in range(0, 4):
		if y[k] == '#':
			x += 1
		else:
			continue
	return x
mat = []
for i in range(0, 4):
	a = input()
	mat.append(a)
zz = 0
for i in range(0, 3):
	for j in range(0, 3):
		y = [mat[i][j], mat[i][j + 1], mat[i + 1][j], mat[i + 1][j + 1]]
		x = counter(y)
		if x == 2:
			continue
		else:
			zz = 1
			break
	if zz == 1:
		break
if zz == 1:
	print('YES')
else:
	print('NO')


from sys import stdin
l = []
for i in range(4):
	s = stdin.readline().rstrip()
	l.append(s)
ans = 0
for i in range(3):
	for j in range(3):
		c = 0
		if l[i][j] == '#':
			c += 1
		if l[i + 1][j] == '#':
			c += 1
		if l[i][j + 1] == '#':
			c += 1
		if l[i + 1][j + 1] == '#':
			c += 1
		if c != 2:
			ans = 1
print('YES' if ans == 1 else 'NO')


s = [input() for _ in ' ' * 4]
c = '.#'
for i in range(3):
	for j in range(3):
		t = sum((s[x][y] == c[0] for y in range(j, j + 2) for x in range(i, i + 2)))
		if t in [0, 1, 3, 4]:
			print('YES')
			exit(0)
print('NO')


from sys import stdin
inp = lambda : stdin.readline().strip()
a = []
for i in range(4):
	a.append(inp())
flag = False
for i in range(4):
	for j in range(4):
		white = 0
		black = 0
		for k in range(2):
			for l in range(2):
				if i + k < 4 and j + l < 4:
					if i + k < 4 and j + l < 4 and (a[i + k][j + l] == '.'):
						white += 1
					else:
						black += 1
		if white == 3 or white == 4 or black == 3 or (black == 4):
			flag = True
	if flag:
		break
if flag:
	print('YES')
else:
	print('NO')


l = []
for i in range(4):
	s = input()
	for j in range(4):
		l.append(s[j])
for i in range(16):
	if i == 3 or i == 7 or i == 11 or (i == 15):
		i = i + 1
	if i == 11 or i == 15 or i == 14 or (i == 13) or (i == 12):
		break
	lis = []
	lis.append(l[i])
	lis.append(l[i + 1])
	lis.append(l[i + 4])
	lis.append(l[i + 4 + 1])
	if lis.count('#') >= 3 or lis.count('.') >= 3:
		print('YES')
		exit()
print('NO')


a = []
flag = 0
for _ in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		if (a[i][j:j + 2] + a[i + 1][j:j + 2]).count('#') > 2 or (a[i][j:j + 2] + a[i + 1][j:j + 2]).count('.') > 2:
			print('YES')
			flag = 1
			break
		elif i == 2 and j == 2:
			print('NO')
	if flag == 1:
		break


List = [input() for i in range(4)]
List2 = List[::-1]
for i in range(3):
	if List[i].count('..') and List[i + 1].count('.'):
		if List[i][List[i + 1].index('.')] == '.':
			print('YES')
			exit(0)
		elif List[i + 1].count('.') >= 2:
			if List[i][List[i + 1].index('.', List[i + 1].index('.') + 1)] == '.':
				print('YES')
				exit(0)
	elif List[i].count('##') and List[i + 1].count('#'):
		if List[i][List[i + 1].index('#')] == '#':
			print('YES')
			exit(0)
		elif List[i + 1].count('#') >= 2:
			if List[i][List[i + 1].index('#', List[i + 1].index('#') + 1)] == '#':
				print('YES')
				exit(0)
for i in range(3):
	if List2[i].count('..') and List2[i + 1].count('.'):
		if List2[i][List2[i + 1].index('.')] == '.':
			print('YES')
			exit(0)
		elif List2[i + 1].count('.') >= 2:
			if List2[i][List2[i + 1].index('.', List2[i + 1].index('.') + 1)] == '.':
				print('YES')
				exit(0)
	elif List2[i].count('##') and List2[i + 1].count('#'):
		if List2[i][List2[i + 1].index('#')] == '#':
			print('YES')
			exit(0)
		elif List2[i + 1].count('#') >= 2:
			if List2[i][List2[i + 1].index('#', List2[i + 1].index('#') + 1)] == '#':
				print('YES')
				exit(0)
else:
	print('NO')


g = [input(), input(), input(), input()]
for i in range(0, 3):
	for j in range(0, 3):
		s = [g[i][j], g[i][j + 1], g[i + 1][j], g[i + 1][j + 1]]
		if s.count('#') != 2:
			print('YES')
			exit()
print('NO')


from collections import Counter
matrix = []
for _ in range(4):
	matrix.append(list(str(input())))
ans = 'NO'
for i in range(3):
	for j in range(3):
		tmp_list = [matrix[i][j], matrix[i][j + 1], matrix[i + 1][j], matrix[i + 1][j + 1]]
		tmp_dict = Counter(tmp_list)
		if max(tmp_dict.values()) >= 3:
			ans = 'YES'
			break
print(ans)


def compare(first, second):
	for i in range(0, 3):
		res = first[i] + first[i + 1] + second[i] + second[i + 1]
		if res.count('#') >= 3 or res.count('.') >= 3:
			return True
	else:
		return False
paterns = []
for i in range(4):
	paterns.append(input())
if compare(paterns[0], paterns[1]) == True or compare(paterns[1], paterns[2]) == True or compare(paterns[2], paterns[3]) == True:
	print('YES')
else:
	print('NO')


import sys
a = [input(), input(), input(), input()]
for i in range(0, 3):
	for j in range(0, 3):
		if a[i:i + 2][0][j:j + 2].count('#') + a[i:i + 2][1][j:j + 2].count('#') > 2 or a[i:i + 2][0][j:j + 2].count('.') + a[i:i + 2][1][j:j + 2].count('.') > 2:
			print('YES')
			return
print('NO')


grid = []
for i in range(4):
	grid.append(input())
for i in range(3):
	for j in range(3):
		square = [grid[i][j], grid[i][j + 1], grid[i + 1][j], grid[i + 1][j + 1]]
		if square.count('#') > 2 or square.count('.') > 2:
			print('YES')
			exit()
print('NO')


test = []
for i in range(4):
	test.append(input())
good = False
for i in range(4):
	black = 0
	white = 0
	for j in range(4):
		if test[i][j] == '#':
			black += 1
		if j + 1 < 4 and test[i][j + 1] == '#':
			black += 1
		if j + 1 < 4 and i + 1 < 4 and (test[i + 1][j + 1] == '#'):
			black += 1
		if i + 1 < 4 and test[i + 1][j] == '#':
			black += 1
		if test[i][j] == '.':
			white += 1
		if j + 1 < 4 and test[i][j + 1] == '.':
			white += 1
		if j + 1 < 4 and i + 1 < 4 and (test[i + 1][j + 1] == '.'):
			white += 1
		if i + 1 < 4 and test[i + 1][j] == '.':
			white += 1
		if black >= 3:
			good = True
		elif white >= 3:
			good = True
		else:
			black = 0
			white = 0
if good:
	print('YES')
else:
	print('NO')


l = []
for i in range(4):
	a = []
	s = input()
	for char in s:
		if char == '#':
			a.append(0)
		else:
			a.append(1)
	l.append(a)
for i in range(3):
	for j in range(3):
		if l[i][j] ^ l[i][j + 1] ^ (l[i + 1][j] ^ l[i + 1][j + 1]):
			print('YES')
			exit(0)
		if l[i][j] == l[i][j + 1] and l[i + 1][j] == l[i + 1][j + 1] and (l[i][j] == l[i + 1][j]):
			print('YES')
			exit(0)
print('NO')


A = [input() for _ in range(4)]
print('YES' if any(((A[i][j:j + 2] + A[i + 1][j:j + 2]).count('#') != 2 for i in range(3) for j in range(3))) else 'NO')


import time
import collections

class Time_test:

	def __enter__(self):
		self.enter_time = time.time()

	def __exit__(self, exc_type, exc_val, exc_tb):
		print('Command was executed in', time.time() - self.enter_time)

def hs(arr: list):
	return (arr[0][0] and arr[0][1] and arr[1][0] and arr[1][1] or (arr[0][2] and arr[0][3] and arr[1][2] and arr[1][3]) or (arr[0][1] and arr[0][2] and arr[1][1] and arr[1][2]) or (arr[1][0] and arr[1][1] and arr[2][0] and arr[2][1]) or (arr[1][2] and arr[1][3] and arr[2][2] and arr[2][3]) or (arr[1][1] and arr[1][2] and arr[2][1] and arr[2][2]) or (arr[2][0] and arr[2][1] and arr[3][0] and arr[3][1]) or (arr[2][2] and arr[2][3] and arr[3][2] and arr[3][3]) or (arr[2][1] and arr[2][2] and arr[3][1] and arr[3][2])) or (not arr[0][0] and (not arr[0][1]) and (not arr[1][0]) and (not arr[1][1]) or (not arr[0][2] and (not arr[0][3]) and (not arr[1][2]) and (not arr[1][3])) or (not arr[0][1] and (not arr[0][2]) and (not arr[1][1]) and (not arr[1][2])) or (not arr[1][0] and (not arr[1][1]) and (not arr[2][0]) and (not arr[2][1])) or (not arr[1][2] and (not arr[1][3]) and (not arr[2][2]) and (not arr[2][3])) or (not arr[1][1] and (not arr[1][2]) and (not arr[2][1]) and (not arr[2][2])) or (not arr[2][0] and (not arr[2][1]) and (not arr[3][0]) and (not arr[3][1])) or (not arr[2][2] and (not arr[2][3]) and (not arr[3][2]) and (not arr[3][3])) or (not arr[2][1] and (not arr[2][2]) and (not arr[3][1]) and (not arr[3][2])))
arr = [[], [], [], []]
for i in range(4):
	arr[i] = [True if x == '#' else False for x in input()]
if hs(arr):
	print('YES')
	exit()
for (i, string) in enumerate(arr):
	for (j, column) in enumerate(string):
		arr[i][j] = not arr[i][j]
		if hs(arr):
			print('YES')
			exit()
		arr[i][j] = not arr[i][j]
print('NO')


import sys

def findPossibleSquare(matrix):
	row1 = 0
	row2 = 1
	column1 = 0
	column2 = 1
	square = []
	dot = 0
	while True:
		square.append(str(matrix[row1][column1]))
		square.append(str(matrix[row1][column2]))
		square.append(str(matrix[row2][column1]))
		square.append(str(matrix[row2][column2]))
		for point in square:
			if point == '.':
				dot += 1
		if dot <= 1:
			return 'YES'
		if column1 + 1 <= 2 and column2 <= 3:
			column1 += 1
			column2 += 1
		elif row1 + 1 <= 2 and row2 + 1 <= 3:
			row1 += 1
			row2 += 1
			column1 = 0
			column2 = 1
		else:
			square.clear()
			dot = 0
			break
		square.clear()
		dot = 0
	square.clear()
	dot = 0
	row1 = 0
	row2 = 1
	column1 = 0
	column2 = 1
	while True:
		square.append(str(matrix[row1][column1]))
		square.append(str(matrix[row1][column2]))
		square.append(str(matrix[row2][column1]))
		square.append(str(matrix[row2][column2]))
		for point in square:
			if point == '#':
				dot += 1
		if dot <= 1:
			return 'YES'
		if column1 + 1 <= 2 and column2 <= 3:
			column1 += 1
			column2 += 1
		elif row1 + 1 <= 2 and row2 + 1 <= 3:
			row1 += 1
			row2 += 1
			column1 = 0
			column2 = 1
		else:
			break
		square.clear()
		dot = 0
	return 'NO'
matrix = []
for _ in range(4):
	r = input()
	matrix.append(r)
print(findPossibleSquare(matrix))


quadro = [[], [], [], []]
for i in range(4):
	quadro[i] = list(input())
for linha in range(0, 3):
	for coluna in range(4):
		if linha > 2 or coluna > 2:
			continue
		(preto, branco) = (0, 0)
		for l in range(linha, linha + 2):
			for c in range(coluna, coluna + 2):
				if quadro[l][c] == '#':
					preto += 1
				else:
					branco += 1
				if preto >= 3 or branco >= 3:
					print('YES')
					exit(0)
print('NO')


from typing import Counter
import sys
from collections import defaultdict as dd
from math import *

def vinp():
	return map(int, input().split())

def linp():
	return list(map(int, input().split()))

def sinp():
	return input()

def inp():
	return int(input())

def mod(f):
	return f % 1000000007

def pr(x):
	print(x)

def finp():
	f = open('input.txt', 'r')
	f = f.read().split('\n')
	return f

def finp():
	f = open('input.txt', 'r')
	f = f.read().split('\n')
	return f

def fout():
	return open('output.txt', 'w')

def fpr(f, x):
	f.write(x + '\n')

def csort(c):
	sorted(c.items(), key=lambda pair: pair[1], reverse=True)
l = []
p = False
for i in range(4):
	l.append(input())
for i in range(3):
	for j in range(3):
		c = [l[i][j], l[i][j + 1], l[i + 1][j], l[i + 1][j + 1]].count('#')
		if c >= 3 or c <= 1:
			p = True
			break
if p:
	pr('YES')
else:
	pr('NO')


rows = []
possible = False
for i in range(4):
	rows.append(input())
for r in range(3):
	for i in range(3):
		if rows[r][i] == '#' and rows[r + 1][i] == '#' and (rows[r + 1][i + 1] == '#'):
			possible = True
		if rows[r][i] == '.' and rows[r + 1][i] == '.' and (rows[r + 1][i + 1] == '.'):
			possible = True
	for i in range(1, 4):
		if rows[r][i] == '#' and rows[r + 1][i] == '#' and (rows[r + 1][i - 1] == '#'):
			possible = True
		if rows[r][i] == '.' and rows[r + 1][i] == '.' and (rows[r + 1][i - 1] == '.'):
			possible = True
for r in range(1, 4):
	for i in range(3):
		if rows[r][i] == '#' and rows[r - 1][i] == '#' and (rows[r - 1][i + 1] == '#'):
			possible = True
		if rows[r][i] == '.' and rows[r - 1][i] == '.' and (rows[r - 1][i + 1] == '.'):
			possible = True
	for i in range(3):
		if rows[r][i] == '#' and rows[r - 1][i] == '#' and (rows[r - 1][i - 1] == '#'):
			possible = True
		if rows[r][i] == '.' and rows[r - 1][i] == '.' and (rows[r - 1][i - 1] == '.'):
			possible = True
print('YES' if possible else 'NO')


mtx = []
mtx.append(list(map(str, input().split())))
mtx.append(list(map(str, input().split())))
mtx.append(list(map(str, input().split())))
mtx.append(list(map(str, input().split())))
ans = False
for i in range(3):
	for j in range(3):
		current = ''
		current += mtx[i][0][j] + mtx[i][0][j + 1] + mtx[i + 1][0][j] + mtx[i + 1][0][j + 1]
		if current.count('#') == 0 or current.count('#') == 1 or current.count('#') == 3 or (current.count('#') == 4):
			ans = True
			break
	if ans:
		break
if ans:
	print('YES')
else:
	print('NO')


ls = []
for i in range(4):
	ls.append(input())
stat = 'NO'
cnt = 0
for i in range(4):
	for j in range(4):
		try:
			sqr = []
			sqr.append(ls[i][j])
			sqr.append(ls[i][j + 1])
			sqr.append(ls[i + 1][j])
			sqr.append(ls[i + 1][j + 1])
			if sqr.count('#') >= 3 or sqr.count('.') >= 3:
				stat = 'YES'
				break
		except:
			continue
print(stat)


def gint():
	return int(input())

def gint_arr():
	return list(map(int, input().split()))

def gfloat():
	return float(input())

def gfloat_arr():
	return list(map(float, input().split()))

def pair_int():
	return map(int, input().split())
INF = 1 << 31
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
grid = []
for i in range(4):
	grid.append(input())
for i in range(3):
	for j in range(3):
		s = []
		s.append(grid[i][j])
		s.append(grid[i][j + 1])
		s.append(grid[i + 1][j])
		s.append(grid[i + 1][j + 1])
		if s.count(s[0]) in [4, 3, 1]:
			print('YES')
			exit()
print('NO')


def main():
	l = [c == '#' for _ in range(4) for c in input()]
	for sq in ((0, 1, 4, 5), (1, 2, 5, 6), (2, 3, 6, 7), (4, 5, 8, 9), (5, 6, 9, 10), (6, 7, 10, 11), (8, 9, 12, 13), (9, 10, 13, 14), (10, 11, 14, 15)):
		if sum((l[i] for i in sq)) != 2:
			print('YES')
			return
	print('NO')

def __starting_point():
	main()
__starting_point()


a = []
for i in range(4):
	s = input()
	l = []
	for j in s:
		if j == '#':
			l.append(1)
		else:
			l.append(0)
	a.append(l)
x = [0, 0, 1, 1]
y = [0, 1, 1, 0]
found = False
for i in range(3):
	for j in range(3):
		s = 0
		for k in range(4):
			dx = i + x[k]
			dy = j + y[k]
			s += a[dx][dy]
		if s in [0, 4, 3, 1]:
			found = True
if found:
	print('YES')
else:
	print('NO')


a = []
for _ in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		r = 0
		if a[i][j] == a[i][j + 1]:
			r += 1
		if a[i][j] == a[i + 1][j + 1]:
			r += 1
		if a[i][j] == a[i + 1][j]:
			r += 1
		if r > 1 or r == 0:
			print('YES')
			exit()
print('NO')


rec = []
for x in range(4):
	rec.append(input())
ans = []
for x in range(3):
	for j in range(3):
		a = rec[x][j:j + 2] + rec[x + 1][j:j + 2]
		sha = a.count('#')
		dot = a.count('.')
		if max(sha, dot) >= 3:
			ans.append('y')
if 'y' in ans:
	print('YES')
else:
	print('NO')


sq = []

def check(a, b, c, d):
	if sq[a][d] == '.' and sq[c][b] == '.' and (sq[c][d] == '.'):
		print('YES')
		exit()
	if sq[a][d] == '#' and sq[c][b] == '#' and (sq[c][d] == '#'):
		print('YES')
		exit()
for i in range(4):
	sq.append(list(input()))
for i in range(4):
	for j in range(4):
		if i + 1 <= 3 and j + 1 <= 3 and (i + 1 >= 0) and (j + 1 >= 0):
			check(i, j, i + 1, j + 1)
		if i + 1 <= 3 and j - 1 <= 3 and (i + 1 >= 0) and (j - 1 >= 0):
			check(i, j, i + 1, j - 1)
		if i - 1 <= 3 and j + 1 <= 3 and (i - 1 >= 0) and (j + 1 >= 0):
			check(i, j, i - 1, j + 1)
		if i - 1 <= 3 and j - 1 <= 3 and (i - 1 >= 0) and (j - 1 >= 0):
			check(i, j, i - 1, j - 1)
print('NO')


def iq(arr):
	for i in range(3):
		count = 0
		for j in range(3):
			count = 0
			if arr[i][j] == '#':
				count += 1
			if arr[i][j + 1] == '#':
				count += 1
			if arr[i + 1][j] == '#':
				count += 1
			if arr[i + 1][j + 1] == '#':
				count += 1
			if count == 0 or count == 1 or count == 3 or (count == 4):
				print('YES')
				return
	print('NO')
l = []
for i in range(4):
	l.append(input())
iq(l)


from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def time_t():
	print('Current date and time: ', datetime.datetime.now())
	print('Current year: ', datetime.date.today().strftime('%Y'))
	print('Month of year: ', datetime.date.today().strftime('%B'))
	print('Week number of the year: ', datetime.date.today().strftime('%W'))
	print('Weekday of the week: ', datetime.date.today().strftime('%w'))
	print('Day of year: ', datetime.date.today().strftime('%j'))
	print('Day of the month : ', datetime.date.today().strftime('%d'))
	print('Day of week: ', datetime.date.today().strftime('%A'))

def ip():
	return int(input())

def sip():
	return input()

def mip():
	return map(int, input().split())

def mips():
	return map(str, input().split())

def lip():
	return list(map(int, input().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		s = sip()
		arr = []
		for item in s:
			arr.append(item)
		lst.append(arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def prime(n):
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
arr = matip(4, 4)
flag = 0
for i in range(3):
	for j in range(3):
		lst = [arr[i][j], arr[i][j + 1], arr[i + 1][j], arr[i + 1][j + 1]]
		dot = lst.count('.')
		has = lst.count('#')
		if has == 1 or dot == 1 or has == 4 or (dot == 4):
			flag = 1
if flag == 1:
	print('YES')
else:
	print('NO')


square = [[0 for i in range(4)] for i in range(4)]
for i in range(4):
	line = input()
	for j in range(4):
		if line[j] == '#':
			square[i][j] = 1
		else:
			square[i][j] = 0
ans = False
for i in range(3):
	for j in range(3):
		s = square[i][j] + square[i][j + 1] + square[i + 1][j] + square[i + 1][j + 1]
		if s >= 3 or s <= 1:
			ans = True
			break
	if ans:
		break
if ans:
	print('YES')
else:
	print('NO')


def solve():
	rows = []
	for _ in range(4):
		rows.append(input())
	for i in range(3):
		(up, down) = (rows[i], rows[i + 1])
		for j in range(4):
			x = up[j]
			if x == down[j]:
				if j == 0:
					if up[j + 1] == x or down[j + 1] == x:
						return 'YES'
				elif j == 3:
					if up[j - 1] == x or down[j - 1] == x:
						return 'YES'
				elif up[j - 1] == x or up[j + 1] == x or down[j - 1] == x or (down[j + 1] == x):
					return 'YES'
	return 'NO'
print(solve())


l = [''] * 4
a = 0
for i in range(4):
	l[i] = list(input())
for i in range(3):
	if a == 0:
		for j in range(3):
			if l[i + 1][j + 1] == l[i + 1][j] and l[i + 1][j + 1] == l[i][j + 1] or (l[i][j] == l[i + 1][j] and l[i][j] == l[i][j + 1]) or (l[i][j] == l[i + 1][j + 1] and l[i][j] == l[i][j + 1]) or (l[i][j] == l[i + 1][j] and l[i][j] == l[i + 1][j + 1]):
				a += 1
				break
if a == 1:
	print('YES')
else:
	print('NO')


t = []
for _ in range(4):
	t.append(input())
found = False
for x in range(3):
	for y in range(3):
		c = [t[x][y], t[x + 1][y], t[x][y + 1], t[x + 1][y + 1]].count('.')
		if c >= 3 or c <= 1:
			found = True
			break
	if found:
		break
if found:
	print('YES')
else:
	print('NO')


X = [input() for i in range(4)]
for i in range(3):
	for j in range(3):
		Temp = [X[i][j], X[i][j + 1], X[i + 1][j], X[i + 1][j + 1]]
		if Temp.count(Temp[0]) in [3, 4, 1]:
			print('YES')
			exit()
print('NO')


x1 = []
x2 = []
x3 = []
x4 = []
x5 = []
x6 = []
x7 = []
x8 = []
x9 = []
lst1 = []
lst = []
for z in range(4):
	x = list(map(str, input()))
	lst.extend(x)
x1.append(lst[0])
x1.append(lst[1])
x1.append(lst[4])
x1.append(lst[5])
x2.append(lst[2])
x2.append(lst[3])
x2.append(lst[6])
x2.append(lst[7])
x3.append(lst[8])
x3.append(lst[9])
x3.append(lst[12])
x3.append(lst[13])
x4.append(lst[10])
x4.append(lst[11])
x4.append(lst[14])
x4.append(lst[15])
x5.append(lst[1])
x5.append(lst[2])
x5.append(lst[5])
x5.append(lst[6])
x6.append(lst[9])
x6.append(lst[10])
x6.append(lst[13])
x6.append(lst[14])
x7.append(lst[6])
x7.append(lst[7])
x7.append(lst[10])
x7.append(lst[11])
x8.append(lst[4])
x8.append(lst[5])
x8.append(lst[8])
x8.append(lst[9])
x9.append(lst[5])
x9.append(lst[6])
x9.append(lst[9])
x9.append(lst[10])
lst1.append(x1)
lst1.append(x2)
lst1.append(x3)
lst1.append(x4)
lst1.append(x5)
lst1.append(x6)
lst1.append(x7)
lst1.append(x8)
lst1.append(x9)
s = 0
for i in lst1:
	v = i.count(max(i))
	b = i.count(min(i))
	if v >= 3 or b >= 3:
		s += 1
		print('YES')
		break
if s == 0:
	print('NO')


grid = [input().replace(' ', '') for i in range(4)]

def f_dot(s):
	count = 0
	for x in range(2):
		for y in range(2):
			if s[x][y] == '.':
				count += 1
	if count > 1:
		return False
	return True

def f_hash(s):
	count = 0
	for x in range(2):
		for y in range(2):
			if s[x][y] == '#':
				count += 1
	if count > 1:
		return False
	return True

def f(s):
	return f_dot(s) or f_hash(s)

def check(grid):
	for x in range(3):
		for y in range(3):
			if f([[grid[x][y], grid[x + 1][y]], [grid[x][y + 1], grid[x + 1][y + 1]]]):
				return True
	return False
if check(grid):
	print('YES')
else:
	print('NO')


matr = [None] * 4
i = 0
while i < 4:
	matr[i] = input()
	i += 1
flag = False
y = 0
while y < 3:
	i = 0
	while i < 3:
		count = 0
		if matr[y][i] == '#':
			count += 1
		if matr[y][i + 1] == '#':
			count += 1
		if matr[y + 1][i] == '#':
			count += 1
		if matr[y + 1][i + 1] == '#':
			count += 1
		if count != 2:
			flag = True
			y = 3
			i = 3
		i += 1
	y += 1
if flag:
	print('YES')
else:
	print('NO')


li = [input() for i in range(4)]
done = False
for i in range(3):
	for j in range(3):
		(hsh, dot) = (0, 0)
		if li[i][j] == '#':
			hsh += 1
		else:
			dot += 1
		if li[i][j + 1] == '#':
			hsh += 1
		else:
			dot += 1
		if li[i + 1][j] == '#':
			hsh += 1
		else:
			dot += 1
		if li[i + 1][j + 1] == '#':
			hsh += 1
		else:
			dot += 1
		if hsh == 4 or dot == 4 or hsh == 3 or (dot == 3):
			print('YES')
			done = True
			break
	if done == True:
		break
else:
	print('NO')


k = []
for i in range(4):
	k.append(list(input()))
for i in range(len(k) - 1):
	m = k[i]
	p = k[i + 1]
	for j in range(len(m) - 1):
		if m[j:j + 2].count('#') + p[j:j + 2].count('#') != 2:
			print('YES')
			exit()
print('NO')


import sys
import math
input = sys.stdin.readline
a = []
for i in range(4):
	a.append(input().strip())
for i in range(3):
	for j in range(3):
		if [a[i][j], a[i + 1][j], a[i][j + 1], a[i + 1][j + 1]].count('#') >= 3 or [a[i][j], a[i + 1][j], a[i][j + 1], a[i + 1][j + 1]].count('.') >= 3:
			print('YES')
			exit(0)
print('NO')


a = ''.join([input() for _ in [0] * 4])
print(['YES', 'NO'][all(([a[x], a[x + 1], a[x + 4], a[x + 5]].count('#') == 2 for x in [0, 1, 2, 4, 5, 6, 8, 9, 10]))])


grid = [input(), input(), input(), input()]
slice_x = 2
slice_y = 2

def test_slice():
	width = 4
	height = 4
	slices = []
	for i in range(0, height - slice_y + 1):
		for j in range(0, width - slice_x + 1):
			slices.append([[grid[a][b] for b in range(j, j + slice_x)] for a in range(i, i + slice_y)])
	return slices
slices = test_slice()
for sl in slices:
	hashCounter = 0
	dotCounter = 0
	for i in sl:
		hashCounter += i.count('#')
		dotCounter += i.count('.')
	if hashCounter >= 3 or dotCounter >= 3:
		print('YES')
		exit()
print('NO')


a = []
for i in range(4):
	a.append(input())
c = 0
for i in range(3):
	for j in range(3):
		h = 0
		d = 0
		if a[i][j] == '#':
			h += 1
		else:
			d += 1
		if a[i][j + 1] == '#':
			h += 1
		else:
			d += 1
		if a[i + 1][j] == '#':
			h += 1
		else:
			d += 1
		if a[i + 1][j + 1] == '#':
			h += 1
		else:
			d += 1
		if h >= 3 or d >= 3:
			c = 1
			print('YES')
			break
	if c == 1:
		break
if c == 0:
	print('NO')


def main():
	mat = [['.' for i in range(4)] for i in range(4)]
	for j in range(4):
		s = input()
		s = ' '.join(s)
		s = list(s.split(' '))
		mat[j] = s
	flag = False
	for i in range(3):
		for j in range(3):
			if mat[i][j] == mat[i + 1][j] and mat[i][j] == mat[i][j + 1] and (mat[i][j] == mat[i + 1][j + 1]):
				print('YES')
				flag = True
				break
			elif mat[i][j] == mat[i + 1][j] and mat[i][j] == mat[i][j + 1] and (mat[i][j] != mat[i + 1][j + 1]):
				print('YES')
				flag = True
				break
			elif mat[i][j] == mat[i + 1][j] and mat[i][j] != mat[i][j + 1] and (mat[i][j] == mat[i + 1][j + 1]):
				print('YES')
				flag = True
				break
			elif mat[i][j] != mat[i + 1][j] and mat[i][j] == mat[i][j + 1] and (mat[i][j] == mat[i + 1][j + 1]):
				print('YES')
				flag = True
				break
			elif mat[i][j] != mat[i + 1][j] and mat[i][j] != mat[i][j + 1] and (mat[i][j] != mat[i + 1][j + 1]):
				print('YES')
				flag = True
				break
			else:
				continue
		if flag == True:
			break
	if flag == False:
		print('NO')
main()


from collections import Counter

def main():
	lines = []
	for _ in range(4):
		lines.append(input())
	for i in range(3):
		for j in range(3):
			square = Counter(lines[i][j:j + 2] + lines[i + 1][j:j + 2])
			if max(square.values()) > 2:
				print('YES')
				return
	print('NO')
main()


arr = []
for i in range(4):
	arr.append(str(input()))
answer = 'NO'
for i in range(3):
	for j in range(3):
		countOne = 0
		if arr[i][j:j + 1] == '#':
			countOne += 1
		if arr[i][j + 1:j + 2] == '#':
			countOne += 1
		if arr[i + 1][j:j + 1] == '#':
			countOne += 1
		if arr[i + 1][j + 1:j + 2] == '#':
			countOne += 1
		if 4 - countOne == 1 or 4 - countOne == 3 or 4 - countOne == 0 or (4 - countOne == 4):
			answer = 'YES'
print(answer)


__author__ = 'runekri3'
BOX_INDEXES = [[0, 1, 4, 5], [1, 2, 5, 6], [2, 3, 6, 7], [4, 5, 8, 9], [5, 6, 9, 10], [6, 7, 10, 11], [8, 9, 12, 13], [9, 10, 13, 14], [10, 11, 14, 15]]
data = ''
for _ in range(4):
	data += input('')
result = 'NO'
for box_index in BOX_INDEXES:
	hashtag_count = 0
	for index in box_index:
		if data[index] == '#':
			hashtag_count += 1
	if hashtag_count != 2:
		result = 'YES'
		break
print(result)


class CodeforcesTask287ASolution:

	def __init__(self):
		self.result = ''
		self.square = []

	def read_input(self):
		self.square = [input() for x in range(4)]

	def process_task(self):
		can = False
		for x in range(3):
			for y in range(3):
				b = 0
				for i in range(2):
					for j in range(2):
						if self.square[x + i][y + j] == '#':
							b += 1
				if b == 1 or b == 3 or b == 0 or (b == 4):
					can = True
		self.result = 'NO' if not can else 'YES'

	def get_result(self):
		return self.result
Solution = CodeforcesTask287ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


a = []
for _ in range(4):
	a.append(list(map(lambda x: int(x == '#'), input())))
res = False
for i in range(3):
	for j in range(3):
		res = res or a[i][j] + a[i + 1][j] + a[i][j + 1] + a[i + 1][j + 1] != 2
print('YES' if res else 'NO')


l = []
k = 0
for i in range(4):
	s = input()
	l1 = []
	for j in s:
		l1.append(j)
	l.append(l1)
del l1
for i in range(3):
	for j in range(3):
		b = 0
		w = 0
		if l[i][j] == '.':
			w += 1
		else:
			b += 1
		if l[i][j + 1] == '.':
			w += 1
		else:
			b += 1
		if l[i + 1][j] == '.':
			w += 1
		else:
			b += 1
		if l[i + 1][j + 1] == '.':
			w += 1
		else:
			b += 1
		if b > 2 or w > 2:
			k = 1
			break
if k == 0:
	print('NO')
else:
	print('YES')


a = input()
b = input()
c = input()
d = input()
arr = []
count = 0
if a[0] == '#':
	count += 1
if a[1] == '#':
	count += 1
if b[0] == '#':
	count += 1
if b[1] == '#':
	count += 1
arr.append(count)
count = 0
if a[1] == '#':
	count += 1
if a[2] == '#':
	count += 1
if b[1] == '#':
	count += 1
if b[2] == '#':
	count += 1
arr.append(count)
count = 0
if a[2] == '#':
	count += 1
if a[3] == '#':
	count += 1
if b[2] == '#':
	count += 1
if b[3] == '#':
	count += 1
arr.append(count)
count = 0
if b[0] == '#':
	count += 1
if b[1] == '#':
	count += 1
if c[0] == '#':
	count += 1
if c[1] == '#':
	count += 1
arr.append(count)
count = 0
if c[1] == '#':
	count += 1
if c[2] == '#':
	count += 1
if b[1] == '#':
	count += 1
if b[2] == '#':
	count += 1
arr.append(count)
count = 0
if c[2] == '#':
	count += 1
if c[3] == '#':
	count += 1
if b[2] == '#':
	count += 1
if b[3] == '#':
	count += 1
arr.append(count)
count = 0
if c[0] == '#':
	count += 1
if c[1] == '#':
	count += 1
if d[0] == '#':
	count += 1
if d[1] == '#':
	count += 1
arr.append(count)
count = 0
if c[1] == '#':
	count += 1
if c[2] == '#':
	count += 1
if d[1] == '#':
	count += 1
if d[2] == '#':
	count += 1
arr.append(count)
count = 0
if c[2] == '#':
	count += 1
if c[3] == '#':
	count += 1
if d[2] == '#':
	count += 1
if d[3] == '#':
	count += 1
arr.append(count)
count = 0
if a[0] == '.':
	count += 1
if a[1] == '.':
	count += 1
if b[0] == '.':
	count += 1
if b[1] == '.':
	count += 1
arr.append(count)
count = 0
if a[1] == '.':
	count += 1
if a[2] == '.':
	count += 1
if b[1] == '.':
	count += 1
if b[2] == '.':
	count += 1
arr.append(count)
count = 0
if a[2] == '.':
	count += 1
if a[3] == '.':
	count += 1
if b[2] == '.':
	count += 1
if b[3] == '.':
	count += 1
arr.append(count)
count = 0
if b[0] == '.':
	count += 1
if b[1] == '.':
	count += 1
if c[0] == '.':
	count += 1
if c[1] == '.':
	count += 1
arr.append(count)
count = 0
if c[1] == '.':
	count += 1
if c[2] == '.':
	count += 1
if b[1] == '.':
	count += 1
if b[2] == '.':
	count += 1
arr.append(count)
count = 0
if c[2] == '.':
	count += 1
if c[3] == '.':
	count += 1
if b[2] == '.':
	count += 1
if b[3] == '.':
	count += 1
arr.append(count)
count = 0
if c[0] == '.':
	count += 1
if c[1] == '.':
	count += 1
if d[0] == '.':
	count += 1
if d[1] == '.':
	count += 1
arr.append(count)
count = 0
if c[1] == '.':
	count += 1
if c[2] == '.':
	count += 1
if d[1] == '.':
	count += 1
if d[2] == '.':
	count += 1
arr.append(count)
count = 0
if c[2] == '.':
	count += 1
if c[3] == '.':
	count += 1
if d[2] == '.':
	count += 1
if d[3] == '.':
	count += 1
arr.append(count)
arr.sort()
if arr[-1] == 3 or arr[-1] == 4:
	print('YES')
else:
	print('NO')


s1 = input()
s2 = input()
s3 = input()
s4 = input()
x1 = s1[0] + s1[1] + s2[0] + s2[1]
x2 = s1[1] + s1[2] + s2[1] + s2[2]
x3 = s1[2] + s1[3] + s2[2] + s2[3]
x4 = s2[0] + s2[1] + s3[0] + s3[1]
x5 = s2[1] + s2[2] + s3[1] + s3[2]
x6 = s2[2] + s2[3] + s3[2] + s3[3]
x7 = s3[0] + s3[1] + s4[0] + s4[1]
x8 = s3[1] + s3[2] + s4[1] + s4[2]
x9 = s3[2] + s3[3] + s4[2] + s4[3]
x1 = sorted(x1)
x2 = sorted(x2)
x3 = sorted(x3)
x4 = sorted(x4)
x5 = sorted(x5)
x6 = sorted(x6)
x7 = sorted(x7)
x8 = sorted(x8)
x9 = sorted(x9)
if x1.count(x1[0]) == 3 or x1.count(x1[3]) == 3 or x1.count(x1[3]) == 4:
	print('YES')
elif x1.count(x2[0]) == 3 or x2.count(x2[3]) == 3 or x2.count(x2[3]) == 4:
	print('YES')
elif x3.count(x3[0]) == 3 or x3.count(x3[3]) == 3 or x3.count(x3[3]) == 4:
	print('YES')
elif x4.count(x4[0]) == 3 or x4.count(x4[3]) == 3 or x4.count(x4[3]) == 4:
	print('YES')
elif x5.count(x5[0]) == 3 or x5.count(x5[3]) == 3 or x5.count(x5[3]) == 4:
	print('YES')
elif x6.count(x6[0]) == 3 or x6.count(x6[3]) == 3 or x6.count(x6[3]) == 4:
	print('YES')
elif x7.count(x7[0]) == 3 or x7.count(x7[3]) == 3 or x7.count(x7[3]) == 4:
	print('YES')
elif x8.count(x8[0]) == 3 or x8.count(x8[3]) == 3 or x8.count(x8[3]) == 4:
	print('YES')
elif x9.count(x9[0]) == 3 or x9.count(x9[3]) == 3 or x9.count(x9[3]) == 4:
	print('YES')
else:
	print('NO')


grid = []
for _ in range(4):
	s = list(input())
	grid.append(s)
f = False
for i in range(3):
	for j in range(3):
		(cb, cw) = (0, 0)
		for k in range(i, i + 2):
			for l in range(j, j + 2):
				if grid[k][l] == '#':
					cb += 1
				else:
					cw += 1
		if cb >= 3 or cw >= 3:
			f = True
if f:
	print('YES')
else:
	print('NO')


values = []
yes = False
for i in range(4):
	line = list(input())
	seg1 = line[:2]
	seg2 = line[1:3]
	seg3 = line[2:4]
	arr = [0, 0, 0]
	if seg1.count('#') == 1:
		arr[0] = 1
	elif seg1.count('#') == 2:
		arr[0] = 2
	if seg2.count('#') == 1:
		arr[1] = 1
	elif seg2.count('#') == 2:
		arr[1] = 2
	if seg3.count('#') == 1:
		arr[2] = 1
	elif seg3.count('#') == 2:
		arr[2] = 2
	values.append(arr)
for i in range(len(values)):
	values[i].append(5)
values.append([5, 5, 5, 5])
for row in range(4):
	for column in range(3):
		if values[row][column] == 2 and values[row + 1][column] == 1 or (values[row][column] == 1 and values[row + 1][column] == 2) or (values[row][column] == 2 and values[row + 1][column] == 2) or (values[row][column] == 0 and values[row + 1][column] == 0) or (values[row][column] == 1 and values[row + 1][column] == 0) or (values[row][column] == 0 and values[row + 1][column] == 1):
			yes = True
if yes:
	print('YES')
else:
	print('NO')


import operator as op
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import reduce
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def def_value():
	return 0

def def_value2():
	return []
a = []
for i in range(4):
	a.append(input())
res = 'NO'
for i in range(3):
	for j in range(3):
		h = 0
		d = 0
		for x in range(i, i + 2):
			for y in range(j, j + 2):
				if a[x][y] == '#':
					h += 1
				else:
					d += 1
		if h == 1 or d == 1 or h == 4 or (d == 4):
			res = 'YES'
			break
print(res)


s = 0
lst = [[str(t) for t in input()] for i in range(4)]
for i in range(3):
	for j in range(3):
		d = lst[i][j] + lst[i][j + 1] + lst[i + 1][j] + lst[i + 1][j + 1]
		if d.count('#') != 2:
			s += 1
			print('YES')
			break
	if s > 0:
		break
if s == 0:
	print('NO')


l = []
for i in range(4):
	l.append(input())
ans = 'NO'
for i in range(3):
	for j in range(3):
		x = l[i][j + 1] + l[i][j] + l[i + 1][j + 1] + l[i + 1][j]
		if x.count('#') == 3 or x.count('.') == 3 or x.count('#') == 4 or (x.count('.') == 4):
			ans = 'YES'
print(ans)


def main():
	grid = [input() for _ in range(4)]
	for i in range(1, 4):
		for j in range(1, 4):
			neigh = [grid[i][j], grid[i - 1][j], grid[i][j - 1], grid[i - 1][j - 1]]
			if neigh.count('#') >= 3 or neigh.count('.') >= 3:
				print('YES')
				return
	print('NO')
main()


x1 = input()
x2 = input()
x3 = input()
x4 = input()
for i in range(0, 2):
	if x1[i] == x2[i] == x1[i + 1] or x1[i] == x2[i] == x2[i + 1]:
		print('YES')
		exit()
	if x2[i] == x3[i] == x2[i + 1] or x2[i] == x3[i] == x3[i + 1]:
		print('YES')
		exit()
	if x3[i] == x4[i] == x3[i + 1] or x3[i] == x4[i] == x4[i + 1]:
		print('YES')
		exit()
for i in range(3, 1, -1):
	if x1[i] == x2[i] == x1[i - 1] or x1[i] == x2[i] == x2[i + -1]:
		print('YES')
		exit()
	if x2[i] == x3[i] == x2[i - 1] or x2[i] == x3[i] == x3[i - 1]:
		print('YES')
		exit()
	if x3[i] == x4[i] == x3[i - 1] or x3[i] == x4[i] == x4[i - 1]:
		print('YES')
		exit()
print('NO')


from sys import exit
a = []
b = []
for i in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		b = []
		b.append(a[i][j])
		b.append(a[i][j + 1])
		b.append(a[i + 1][j])
		b.append(a[i + 1][j + 1])
		h = b.count('#')
		if h == 1 or h == 4:
			print('YES')
			exit()
		d = b.count('.')
		if d == 1 or d == 4:
			print('YES')
			exit()
print('NO')


a = [[j for j in input()] for i in range(4)]
for j in range(3):
	for k in range(3):
		if a[j][k] == a[j][k + 1]:
			if (a[j + 1][k] != a[j + 1][k + 1]) | (a[j + 1][k] == a[j + 1][k + 1] == a[j][k] == a[j][k + 1]):
				print('YES')
				exit()
		elif a[j + 1][k] == a[j + 1][k + 1]:
			print('YES')
			exit()
print('NO')


a = []
for i in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		k = 0
		if a[i][j] == '#':
			k += 1
		if a[i][j + 1] == '#':
			k += 1
		if a[i + 1][j] == '#':
			k += 1
		if a[i + 1][j + 1] == '#':
			k += 1
		if k >= 3:
			print('YES')
			exit()
		k = 0
		if a[i][j] == '.':
			k += 1
		if a[i][j + 1] == '.':
			k += 1
		if a[i + 1][j] == '.':
			k += 1
		if a[i + 1][j + 1] == '.':
			k += 1
		if k >= 3:
			print('YES')
			exit()
print('NO')


import sys
l0 = list(input())
l1 = list(input())
l2 = list(input())
l3 = list(input())
l = [l0, l1, l2, l3]

def check(a, b, c, d):
	q = [a, b, c, d]
	q.sort()
	if q == ['#', '#', '#', '#'] or q == ['#', '#', '#', '.'] or q == ['.', '.', '.', '.'] or (q == ['#', '.', '.', '.']):
		return True
	else:
		return False
for i in range(3):
	for j in range(3):
		if check(l[i][j], l[i + 1][j], l[i][j + 1], l[i + 1][j + 1]):
			print('YES')
			sys.exit(0)
print('NO')


a = input()
b = input()
c = input()
d = input()
f = []
for i in range(3):
	f.append(a[i])
	f.append(a[i + 1])
	f.append(b[i])
	f.append(b[i + 1])
	if f.count('.') == 3 or f.count('#') == 3 or f.count('.') == 4 or (f.count('#') == 4):
		print('YES')
		exit(0)
	f = []
	f.append(b[i])
	f.append(b[i + 1])
	f.append(c[i])
	f.append(c[i + 1])
	if f.count('.') == 3 or f.count('#') == 3 or f.count('.') == 4 or (f.count('#') == 4):
		print('YES')
		exit(0)
	f = []
	f.append(c[i])
	f.append(c[i + 1])
	f.append(d[i])
	f.append(d[i + 1])
	if f.count('.') == 3 or f.count('#') == 3 or f.count('.') == 4 or (f.count('#') == 4):
		print('YES')
		exit(0)
	f = []
print('NO')


one = input()
two = input()
three = input()
four = input()
p = False
for x in range(3):
	s_one = [one[x], one[x + 1], two[x], two[x + 1]]
	s_two = [two[x], two[x + 1], three[x], three[x + 1]]
	s_three = [three[x], three[x + 1], four[x], four[x + 1]]
	if s_one.count('#') >= 3 or s_two.count('#') >= 3 or s_three.count('#') >= 3 or (s_one.count('.') >= 3) or (s_two.count('.') >= 3) or (s_three.count('.') >= 3):
		print('YES')
		p = True
		break
if not p:
	print('NO')


a = []
ans = 'NO'
for i in range(4):
	a.append(list(input()))
for i in range(3):
	for j in range(3):
		l = [a[i][j], a[i + 1][j], a[i][j + 1], a[i + 1][j + 1]]
		if l.count('.') == 1 or l.count('.') == 0 or l.count('#') == 0 or (l.count('#') == 1):
			ans = 'YES'
			break
	if ans == 'YES':
		break
print(ans)


lst = []
for i in range(4):
	lst.append(list(input()))
for i in range(3):
	hashes = 0
	dots = 0
	for j in range(1, 4):
		if lst[i][j] == '#':
			hashes += 1
		else:
			dots += 1
		if lst[i][j - 1] == '#':
			hashes += 1
		else:
			dots += 1
		if lst[i + 1][j] == '#':
			hashes += 1
		else:
			dots += 1
		if lst[i + 1][j - 1] == '#':
			hashes += 1
		else:
			dots += 1
		if abs(hashes - dots) >= 2:
			print('YES')
			exit()
print('NO')


arr = []
for i in range(4):
	line = input()
	arr.append(line)
thereis = False
for i in range(3):
	for j in range(3):
		count = int(arr[i][j] == '.') + int(arr[i + 1][j] == '.') + int(arr[i][j + 1] == '.') + int(arr[i + 1][j + 1] == '.')
		if count != 2:
			thereis = True
			break
if thereis:
	print('YES')
else:
	print('NO')


iq = []
for i in range(4):
	iq.append(input())
result = 'NO'
for i in range(3):
	for j in range(3):
		r = iq[i][j] == iq[i + 1][j]
		r += iq[i][j] == iq[i][j + 1]
		r += iq[i][j] == iq[i + 1][j + 1]
		if r >= 2 or r == 0:
			result = 'YES'
			break
print(result)


str1 = input()
str2 = input()
str3 = input()
str4 = input()
mat = [str1, str2, str3, str4]
count = 0
for i in range(3):
	for j in range(3):
		if mat[i][j] == mat[i + 1][j] and mat[i][j] == mat[i][j + 1] or (mat[i][j] == mat[i + 1][j] and mat[i][j] == mat[i + 1][j + 1]) or (mat[i][j] == mat[i][j + 1] and mat[i][j] == mat[i + 1][j + 1]) or (mat[i + 1][j] == mat[i][j + 1] and mat[i + 1][j] == mat[i + 1][j + 1]):
			count = 1
			break
		else:
			continue
if count == 0:
	print('NO')
else:
	print('YES')


def solution():
	st = []
	for i in range(4):
		s = input()
		st.append(s)
	for i in range(0, 3):
		for j in range(0, 3):
			p = [st[i][j], st[i + 1][j], st[i][j + 1], st[i + 1][j + 1]]
			if p.count('#') == 3 or p.count('.') == 3 or p.count('#') == 4 or (p.count('.') == 4):
				print('YES')
				return
	print('NO')
	return
solution()


lines = []
for i in range(4):
	line = list(input())
	lines.append(line)
for i in range(3):
	for j in range(3):
		count_hash = 0
		count_dot = 0
		if lines[i][j] == '#':
			count_hash += 1
		else:
			count_dot += 1
		if lines[i + 1][j] == '#':
			count_hash += 1
		else:
			count_dot += 1
		if lines[i][j + 1] == '#':
			count_hash += 1
		else:
			count_dot += 1
		if lines[i + 1][j + 1] == '#':
			count_hash += 1
		else:
			count_dot += 1
		if count_hash > 2 or count_dot > 2:
			print('YES')
			exit()
print('NO')


__copyright__ = ''
__author__ = 'Son-Huy TRAN'
__email__ = 'sonhuytran@gmail.com'
__doc__ = ''
__version__ = '1.0'

def can_paint(wall: list) -> bool:
	for i in range(3):
		for j in range(3):
			temp = wall[i][j] + wall[i + 1][j] + wall[i][j + 1] + wall[i + 1][j + 1]
			if temp.count('.') != temp.count('#'):
				return True
	return False

def main() -> int:
	wall = [input(), input(), input(), input()]
	print('YES' if can_paint(wall) else 'NO')
	return 0
exit(main())


rows = [list(input()) for x in range(4)]

def squarey(a, b):
	if rows[x][y] == rows[x][y + b] == rows[x + a][y] == rows[x + a][y + b]:
		return True
	else:
		return False

def squarex(a):
	condition = False
	if y > 0:
		condition = squarey(a, -1)
	if not condition and y < 3:
		condition = squarey(a, 1)
	return condition

def check():
	condition = False
	if x > 0:
		condition = squarex(-1)
	if not condition:
		if x < 3:
			condition = squarex(1)
	return condition
condition = False
for x in range(4):
	for y in range(4):
		condition = check()
		if not condition:
			r = rows[x][y]
			if r == '#':
				rows[x][y] = '.'
				condition = check()
				rows[x][y] = '#'
			else:
				rows[x][y] = '#'
				condition = check()
				rows[x][y] = '.'
		if condition:
			print('YES')
			break
	if condition:
		break
else:
	print('NO')


lst = []
for i in range(4):
	lst.append(list(input()))
for i in range(3):
	for j in range(3):
		if lst[i][j] == lst[i][j + 1] and lst[i][j] == lst[i + 1][j] or (lst[i + 1][j + 1] == lst[i][j + 1] and lst[i + 1][j + 1] == lst[i + 1][j]) or (lst[i + 1][j] == lst[i][j] and lst[i + 1][j] == lst[i + 1][j + 1]) or (lst[i][j + 1] == lst[i][j] and lst[i][j + 1] == lst[i + 1][j + 1]):
			print('YES')
			quit()
print('NO')


l = []
f = 0
for i in range(4):
	s = input()
	l.append(s)
f = 0
for i in range(0, 3):
	for j in range(0, 3):
		if l[i][j] == '#':
			c = 0
			if l[i + 1][j] == '#':
				c += 1
			if l[i][j + 1] == '#':
				c += 1
			if l[i + 1][j + 1] == '#':
				c += 1
			if c >= 2:
				f = 1
				break
			elif c == 0:
				f = 1
				break
		else:
			c = 0
			if l[i + 1][j] == '#':
				c += 1
			if l[i][j + 1] == '#':
				c += 1
			if l[i + 1][j + 1] == '#':
				c += 1
			if c == 3:
				f = 1
				break
			elif c <= 1:
				f = 1
				break
	if f == 1:
		break
if f == 1:
	print('YES')
else:
	print('NO')


def sa(a, b, c, d):
	if a == b == c or a == b == d or a == c == d or (b == c == d):
		return True
	else:
		return False
tx = 0
t = []
for inpt in range(4):
	chars = []
	for char in input():
		chars.append(char)
	t.append(chars)
if sa(t[0][0], t[0][1], t[1][0], t[1][1]) or sa(t[0][1], t[0][2], t[1][1], t[1][2]) or sa(t[0][2], t[0][3], t[1][2], t[1][3]):
	print('YES')
elif sa(t[1][0], t[1][1], t[2][0], t[2][1]) or sa(t[1][1], t[1][2], t[2][1], t[2][2]) or sa(t[1][2], t[1][3], t[2][2], t[2][3]):
	print('YES')
elif sa(t[2][0], t[2][1], t[3][0], t[3][1]) or sa(t[2][1], t[2][2], t[3][1], t[3][2]) or sa(t[2][2], t[2][3], t[3][2], t[3][3]):
	print('YES')
else:
	print('NO')


import sys
import math
import bisect

def solve(A):
	n = len(A)
	for i in range(1, n):
		for j in range(1, n):
			val = 0
			if A[i - 1][j - 1] == '#':
				val += 1
			if A[i - 1][j] == '#':
				val += 1
			if A[i][j - 1] == '#':
				val += 1
			if A[i][j] == '#':
				val += 1
			if val == 0 or val == 1 or val == 3 or (val == 4):
				return True
	return False

def main():
	A = []
	for i in range(4):
		A.append(input())
	if solve(A):
		print('YES')
	else:
		print('NO')
main()


L2 = []
L = []
for i in range(4):
	L = []
	ch = input()
	L.extend(ch)
	L2.append(L)
test = False
for i in range(3):
	for j in range(3):
		L1 = []
		L1.append(L2[i][j])
		L1.append(L2[i + 1][j])
		L1.append(L2[i][j + 1])
		L1.append(L2[i + 1][j + 1])
		if L1.count('.') >= 3 or L1.count('#') >= 3:
			test = True
			break
	if test:
		break
if test:
	print('YES')
else:
	print('NO')


z = []
z.append(list(input()))
n = len(z[0])
k = 0
for i in range(n - 1):
	z.append(list(input()))
for i in range(n - 1):
	for j in range(n - 1):
		o = 0
		if z[i][j] == '.':
			o += 1
		if z[i + 1][j] == '.':
			o += 1
		if z[i][j + 1] == '.':
			o += 1
		if z[i + 1][j + 1] == '.':
			o += 1
		if not o == 2:
			k += 1
			break
	if k > 0:
		break
if k > 0:
	print('YES')
else:
	print('NO')


matriz = []
flag = 0
for i in range(4):
	matriz.append(list(input()))
for i in range(3):
	for j in range(3):
		hashtag = 0
		hifen = 0
		if matriz[i][j] == '#':
			hashtag += 1
		else:
			hifen += 1
		if matriz[i + 1][j] == '#':
			hashtag += 1
		else:
			hifen += 1
		if matriz[i][j + 1] == '#':
			hashtag += 1
		else:
			hifen += 1
		if matriz[i + 1][j + 1] == '#':
			hashtag += 1
		else:
			hifen += 1
		if hashtag >= 3 or hifen >= 3:
			flag += 1
			print('YES')
			break
	if flag > 0:
		break
if flag == 0:
	print('NO')


c = [['1', '2', '3', '4'], ['1', '2', '3', '4'], ['4', '3', '2', '1'], ['2', '3', '4', '5']]
lst = []
f = 0
for i in range(4):
	a = list(input())
	lst.append(a)
cl = []
for i in range(3):
	for j in range(3):
		(a, b, c, d) = (lst[i][j], lst[i][j + 1], lst[i + 1][j], lst[i + 1][j + 1])
		cl = []
		cl.append(a)
		cl.append(b)
		cl.append(c)
		cl.append(d)
		if cl.count('#') == 3 or cl.count('.') == 3:
			f = 1
		if cl.count('#') == 4 or cl.count('.') == 4:
			f = 1
if f == 1:
	print('YES')
else:
	print('NO')


def isSafe(r, c, n, m):
	if r < n and c < m and (r >= 0) and (c >= 0):
		return True
	return False
s = []
for i in range(4):
	k = input()
	s.append(k)
n = 4
m = 4
for i in range(len(s)):
	for j in range(len(s[i])):
		if isSafe(i + 1, j, n, m) and isSafe(i, j + 1, n, m) and isSafe(i + 1, j + 1, n, m):
			con = 0
			ton = 0
			if s[i][j] == '#':
				con += 1
			if s[i + 1][j] == '#':
				con += 1
			if s[i][j + 1] == '#':
				con += 1
			if s[i + 1][j + 1] == '#':
				con += 1
			if s[i][j] == '.':
				ton += 1
			if s[i + 1][j] == '.':
				ton += 1
			if s[i][j + 1] == '.':
				ton += 1
			if s[i + 1][j + 1] == '.':
				ton += 1
			if con >= 3 or ton >= 3:
				print('YES')
				exit()
print('NO')


import sys, os, io, time, copy, math
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	arr = []
	for i in range(4):
		x = input()
		a = []
		for s in x:
			a.append(s)
		arr.append(a)
	flag = 0
	for i in range(3):
		for j in range(3):
			count_hash = 0
			count_dot = 0
			if arr[i][j] == '#':
				count_hash += 1
			if arr[i][j + 1] == '#':
				count_hash += 1
			if arr[i + 1][j] == '#':
				count_hash += 1
			if arr[i + 1][j + 1] == '#':
				count_hash += 1
			if arr[i][j] == '.':
				count_dot += 1
			if arr[i][j + 1] == '.':
				count_dot += 1
			if arr[i + 1][j] == '.':
				count_dot += 1
			if arr[i + 1][j + 1] == '.':
				count_dot += 1
			if count_hash > flag:
				flag = count_hash
			if count_dot > flag:
				flag = count_dot
	if flag >= 3:
		print('YES')
	else:
		print('NO')
main()


s = [input() for _ in range(4)]
for i in range(0, 3):
	for j in range(0, 3):
		ans = s[i][j] + s[i][j + 1] + s[i + 1][j] + s[i + 1][j + 1]
		if ans.count('.') > 2 or ans.count('#') > 2:
			print('YES')
			exit()
print('NO')


l = []
for _ in range(4):
	l.append(list(input()))
for i in range(3):
	for j in range(3):
		s = [l[i][j], l[i][j + 1], l[i + 1][j + 1], l[i + 1][j]]
		if len(set(s)) == 1:
			print('YES')
			exit()
		elif s.count('.') == 1 or s.count('#') == 1:
			print('YES')
			exit()
print('NO')


a = [[0 for x in range(4)] for y in range(4)]
input1 = input()
input2 = input()
input3 = input()
input4 = input()
for x in range(4):
	a[0][x] = input1[x]
	a[1][x] = input2[x]
	a[2][x] = input3[x]
	a[3][x] = input4[x]
num = 0
for x in range(3):
	if num == 'yes':
		break
	for y in range(3):
		num = 0
		if a[x][y] == '#':
			num += 1
		if a[x + 1][y] == '#':
			num += 1
		if a[x][y + 1] == '#':
			num += 1
		if a[x + 1][y + 1] == '#':
			num += 1
		if num == 0 or num == 4 or num == 3 or (num == 1):
			print('YES')
			num = 'yes'
			break
if num != 'yes':
	print('NO')


a = input()
b = input()
c = input()
d = input()
k = 0
for i in range(3):
	L = [a[i], a[i + 1], b[i], b[i + 1]]
	if L.count('#') >= 3 or L.count('.') >= 3:
		print('YES')
		k = 1
		break
if k == 0:
	for i in range(3):
		L = [b[i], b[i + 1], c[i], c[i + 1]]
		if L.count('#') >= 3 or L.count('.') >= 3:
			print('YES')
			k = 1
			break
if k == 0:
	for i in range(3):
		L = [c[i], c[i + 1], d[i], d[i + 1]]
		if L.count('#') >= 3 or L.count('.') >= 3:
			print('YES')
			k = 1
			break
if k == 0:
	print('NO')


g = []
for _ in range(4):
	g.append(input())
ans = 'NO'
for r in range(3):
	for c in range(3):
		if g[r][c] == g[r][c + 1] == g[r + 1][c] or g[r][c] == g[r + 1][c] == g[r + 1][c + 1] or g[r][c] == g[r][c + 1] == g[r + 1][c + 1] or (g[r][c + 1] == g[r + 1][c] == g[r + 1][c + 1]):
			ans = 'YES'
			break
	if ans == 'YES':
		break
print(ans)


from collections import Counter

def solve():
	l = []
	for i in range(4):
		l.append(list(input()))
	j = 0
	while j < 3:
		x = l[j]
		j += 1
		y = l[j]
		i = 0
		while i < 3:
			s = x[i:i + 2] + y[i:i + 2]
			if s.count('#') <= 1 or s.count('.') <= 1:
				print('YES')
				return
			i += 1
	print('NO')
solve()


a = [[0 for i in range(4)] for j in range(4)]
b = False
for i in range(4):
	s = input()
	for j in range(4):
		a[i][j] = 1 if s[j] == '#' else 0
for i in range(3):
	for j in range(3):
		z = a[i][j] + a[i + 1][j] + a[i][j + 1] + a[i + 1][j + 1]
		if z != 2:
			b = True
print('YES' if b else 'NO')


l1 = []
flag = 0
for i in range(4):
	l = list((x for x in input()))
	l1.append(l)
for i in range(3):
	for j in range(3):
		a = [l1[i][j], l1[i][j + 1], l1[i + 1][j], l1[i + 1][j + 1]]
		if a.count('#') >= 3 or a.count('.') >= 3:
			flag = 1
			break
	if flag == 1:
		break
if flag == 1:
	print('YES')
else:
	print('NO')


l_l = list([input() for _ in range(4)])
dx = [0, 0, 1, 1]
dy = [0, -1, -1, 0]
for i in range(3):
	for j in range(3):
		t = 0
		for z in range(4):
			t += -1 if l_l[i + dy[z]][j + dx[z]] == '#' else 1
		if abs(t) >= 2:
			print('YES')
			quit()
print('NO')


a = [input() for i in range(4)]
for i in range(3):
	for j in range(3):
		s = a[i][j] + a[i + 1][j] + a[i + 1][j + 1] + a[i][j + 1]
		if s.count('.') > 2 or s.count('#') > 2:
			print('YES')
			quit()
print('NO')


o = 0
a = [[0] * 4 for i in range(4)]
for i in range(0, 4):
	z = input()
	for j in range(4):
		if z[j:j + 1] == '.':
			a[i][j] = 0
		else:
			a[i][j] = 1
for i in range(0, 4):
	for j in range(0, 4):
		if i != 3 and j != 3 and (a[i][j] + a[i][j + 1] + a[i + 1][j + 1] + a[i + 1][j] >= 3 or a[i][j] + a[i][j + 1] + a[i + 1][j + 1] + a[i + 1][j] <= 1):
			o = 1
if o == 1:
	print('YES')
else:
	print('NO')


x = []
c = 'NO'
for i in range(4):
	x.append(input())
for a in range(3):
	for b in range(3):
		if (x[a][b:b + 2] + x[a + 1][b:b + 2]).count('#') != 2:
			c = 'YES'
			break
print(c)


def getField():
	field = []
	for i in range(0, 4):
		field.append(input())
	return field

def canPass(field):
	for i in range(0, 3):
		for j in range(0, 3):
			if field[i][j] == field[i + 1][j] == field[i + 1][j + 1]:
				return True
	return False

def canPassTotal(field):
	res = False
	for i in range(0, 4):
		res = res or canPass(field)
		field = rot(field)
	return res

def rot(mat):
	mat = [mat[i] for i in range(len(mat) - 1, -1, -1)]
	t = [[x[i] for x in mat] for i in range(0, len(mat[0]))]
	return t
ans = {'True': 'YES', 'False': 'NO'}
print(ans[str(canPassTotal(getField()))])


lst = []
for i in range(4):
	lst.append(list(map(str, input())))
flag = False
for i in range(3):
	for j in range(3):
		if [lst[i][j], lst[i + 1][j], lst[i][j + 1], lst[i + 1][j + 1]].count('#') in [0, 1, 3, 4]:
			flag = True
print('YNEOS'[flag == False::2])


mat = [input() for _ in range(4)]
ans = 'NO'
neighbours = ((0, 0), (0, 1), (1, 0), (1, 1))
for x in range(3):
	for y in range(3):
		dot_count = 0
		for (i, j) in neighbours:
			if mat[i + x][j + y] == '.':
				dot_count += 1
		if dot_count != 2:
			ans = 'YES'
			break
	if ans == 'YES':
		break
print(ans)


n = 4
vois = 1

def nb_same_square(mat, x, y):
	nb_sign1 = 0
	for dx in range(vois + 1):
		for dy in range(vois + 1):
			elem = mat[x + dx][y + dy]
			nb_sign1 += 1 if elem == '#' else 0
	nb_sign2 = 4 - nb_sign1
	max_same = max(nb_sign1, nb_sign2)
	return max_same

def solve(mat):
	for i in range(n - 1):
		for j in range(n - 1):
			if nb_same_square(mat, i, j) >= 3:
				print('YES')
				return
	print('NO')
mat = [[None for i in range(n)] for j in range(n)]
for i in range(n):
	s = input()
	for j in range(n):
		mat[i][j] = s[j]
solve(mat)


t = [input() for i in range(4)]
ans = 'NO'
for i in range(3):
	for j in range(3):
		s = 0
		for x in range(2):
			for y in range(2):
				s += t[i + x][j + y] == '.'
		if s != 2:
			ans = 'YES'
			break
print(ans)


(a, t) = ([input(), input(), input(), input()], 1)
for i in range(0, 3):
	for j in range(0, 3):
		l = a[i][j] + a[i][j + 1] + a[i + 1][j] + a[i + 1][j + 1]
		r = l.count('#')
		if r != 2:
			t = 0
			break
	if not t:
		break
print('YNEOS'[t::2])


import sys
import time
import os
from math import sqrt, log, log2, ceil, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
from itertools import permutations
import heapq
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
flol = lambda : list(map(float, inp().split(' ')))
flush = lambda : stdout.flush()

def permute(nums):

	def fun(arr, nums, cur, v):
		if len(cur) == len(nums):
			arr.append(cur.copy())
		i = 0
		while i < len(nums):
			if v[i]:
				i += 1
				continue
			else:
				cur.append(nums[i])
				v[i] = 1
				fun(arr, nums, cur, v)
				cur.pop()
				v[i] = 0
				i += 1
		return arr
	res = []
	nums.sort()
	v = [0] * len(nums)
	return fun(res, nums, [], v)

def subsets(res, index, arr, cur):
	res.append(cur.copy())
	for i in range(index, len(arr)):
		cur.append(arr[i])
		subsets(res, i + 1, arr, cur)
		cur.pop()
	return res

def sieve(N):
	root = int(sqrt(N))
	primes = [1] * (N + 1)
	(primes[0], primes[1]) = (0, 0)
	for i in range(2, root + 1):
		if primes[i]:
			for j in range(i * i, N + 1, i):
				primes[j] = 0
	return primes

def bs(arr, l, r, x):
	if x < arr[0] or x > arr[len(arr) - 1]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	p = int(sqrt(n))
	for i in range(5, p + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def solve():
	arr = []
	already = 0
	tobe = 0
	for i in range(4):
		arr.append(list(inp()))
	for i in range(0, 3):
		for j in range(0, 3):
			l = [arr[i][j], arr[i + 1][j], arr[i + 1][j + 1], arr[i][j + 1]]
			if l.count('.') == 1 and l.count('#') == 3 or (l.count('.') == 3 and l.count('#') == 1):
				tobe = 1
			if l.count('.') == 4 or l.count('#') == 4:
				already = 1
	if tobe or already:
		print('YES')
	else:
		print('NO')
start_time = time.time()
s = sieve(10 ** 6)
solve()


def iqTest():
	d = [['1', '', '', '', '', '1']]
	for i in range(4):
		d.append([''] + list(input()) + [''])
	d.append(['1', '', '', '', '', '1'])
	for i in range(1, 5):
		for j in range(1, 5):
			if d[i + 1][j] == d[i][j + 1] == d[i + 1][j + 1] == '#' or d[i + 1][j] == d[i][j + 1] == d[i + 1][j + 1] == '.':
				print('YES')
				return
			if d[i][j - 1] == d[i + 1][j] == d[i + 1][j - 1] == '#' or d[i][j - 1] == d[i + 1][j] == d[i + 1][j - 1] == '.':
				print('YES')
				return
			if d[i][j - 1] == d[i - 1][j - 1] == d[i - 1][j] == '#' or d[i][j - 1] == d[i - 1][j - 1] == d[i - 1][j] == '.':
				print('YES')
				return
			if d[i - 1][j] == d[i - 1][j + 1] == d[i][j + 1] == '#' or d[i - 1][j] == d[i - 1][j + 1] == d[i][j + 1] == '.':
				print('YES')
				return
	print('NO')
iqTest()


import sys
a = []
for i in range(4):
	a.append(input())
for i in range(4):
	row = a[i]
	for j in range(3):
		t = row[j]
		if t != row[j + 1]:
			continue
		if i > 0:
			if t in (a[i - 1][j], a[i - 1][j + 1]):
				print('YES')
				sys.exit()
		if i < 3:
			if t in (a[i + 1][j], a[i + 1][j + 1]):
				print('YES')
				sys.exit()
print('NO')


def paint_square(paper):
	for x in range(3):
		for y in range(3):
			if paper[x][y] == '#' and paper[x + 1][y] == '#' and (paper[x][y + 1] == '#') and (paper[x + 1][y + 1] == '#'):
				return 'YES'
			elif paper[x][y] == '.' and paper[x + 1][y] == '.' and (paper[x][y + 1] == '.') and (paper[x + 1][y + 1] == '.'):
				return 'YES'
			elif paper[x][y] == '.' and paper[x + 1][y] == '#' and (paper[x][y + 1] == '#') and (paper[x + 1][y + 1] == '#'):
				return 'YES'
			elif paper[x][y] == '#' and paper[x + 1][y] == '.' and (paper[x][y + 1] == '#') and (paper[x + 1][y + 1] == '#'):
				return 'YES'
			elif paper[x][y] == '#' and paper[x + 1][y] == '#' and (paper[x][y + 1] == '.') and (paper[x + 1][y + 1] == '#'):
				return 'YES'
			elif paper[x][y] == '#' and paper[x + 1][y] == '#' and (paper[x][y + 1] == '#') and (paper[x + 1][y + 1] == '.'):
				return 'YES'
			elif paper[x][y] == '#' and paper[x + 1][y] == '.' and (paper[x][y + 1] == '.') and (paper[x + 1][y + 1] == '.'):
				return 'YES'
			elif paper[x][y] == '.' and paper[x + 1][y] == '#' and (paper[x][y + 1] == '.') and (paper[x + 1][y + 1] == '.'):
				return 'YES'
			elif paper[x][y] == '.' and paper[x + 1][y] == '.' and (paper[x][y + 1] == '#') and (paper[x + 1][y + 1] == '.'):
				return 'YES'
			elif paper[x][y] == '.' and paper[x + 1][y] == '.' and (paper[x][y + 1] == '.') and (paper[x + 1][y + 1] == '#'):
				return 'YES'
	return 'NO'
paper = []
for x in range(4):
	paper.append(input())
print(paint_square(paper))


import sys
a = [[1 if i == '#' else 0 for i in input()] for j in range(4)]
for i in range(3):
	for j in range(3):
		if a[i][j] + a[i + 1][j] + a[i][j + 1] + a[i + 1][j + 1] != 2:
			print('YES')
			sys.exit()
print('NO')


s1 = input()
s2 = input()
s3 = input()
s4 = input()
i = 0
f = False
while i < 3 and f == False:
	if s1[i] == s2[i] and s1[i + 1] == s2[i + 1] == s1[i] or (s1[i] == s2[i] and s1[i + 1] != s2[i + 1]) or (s1[i] != s2[i] and s1[i + 1] == s2[i + 1]):
		f = True
	i += 1
i = 0
while i < 3 and f == False:
	if s2[i] == s3[i] and s2[i + 1] == s3[i + 1] == s2[i] or (s2[i] == s3[i] and s2[i + 1] != s3[i + 1]) or (s2[i] != s3[i] and s2[i + 1] == s3[i + 1]):
		f = True
	i += 1
i = 0
while i < 3 and f == False:
	if s3[i] == s4[i] and s3[i + 1] == s4[i + 1] == s3[i] or (s3[i] == s4[i] and s3[i + 1] != s4[i + 1]) or (s3[i] != s4[i] and s3[i + 1] == s4[i + 1]):
		f = True
	i += 1
if f:
	print('YES')
else:
	print('NO')


import sys
import math
t = []
for i in range(4):
	t.append([x for x in sys.stdin.readline() if x != '\n'])
for i in range(1, 4):
	for j in range(1, 4):
		c = 0
		if t[i][j] != t[i - 1][j]:
			c += 1
		if t[i][j] != t[i - 1][j - 1]:
			c += 1
		if t[i][j] != t[i][j - 1]:
			c += 1
		if c != 2:
			print('YES')
			exit()
print('NO')


lst = []
for i in range(4):
	temp = input()
	lst.append(temp)
if '##' in lst[0]:
	temp = lst[0].index('##')
	if lst[1][temp] == '#' or lst[1][temp + 1] == '#':
		print('YES')
		exit()
for i in range(1, 3):
	if '##' in lst[i]:
		temp = lst[i].index('##')
		if lst[i - 1][temp] == '#' or lst[i - 1][temp + 1] == '#':
			print('YES')
			exit()
		if lst[i + 1][temp] == '#' or lst[i + 1][temp + 1] == '#':
			print('YES')
			exit()
if '##' in lst[3]:
	temp = lst[3].index('##')
	if lst[2][temp] == '#' or lst[2][temp + 1] == '#':
		print('YES')
		exit()
if '..' in lst[0]:
	temp = lst[0].index('..')
	if lst[1][temp] == '.' or lst[1][temp + 1] == '.':
		print('YES')
		exit()
for i in range(1, 3):
	if '..' in lst[i]:
		temp = lst[i].index('..')
		if lst[i - 1][temp] == '.' or lst[i - 1][temp + 1] == '.':
			print('YES')
			exit()
		if lst[i + 1][temp] == '.' or lst[i + 1][temp + 1] == '.':
			print('YES')
			exit()
if '..' in lst[3]:
	temp = lst[3].index('..')
	if lst[2][temp] == '.' or lst[2][temp + 1] == '.':
		print('YES')
		exit()
print('NO')


s = [list(input()) for i in range(4)]
for i in range(3):
	for j in range(3):
		square = s[i][j] + s[i + 1][j] + s[i][j + 1] + s[i + 1][j + 1]
		if square.count('#') >= 3 or square.count('.') >= 3:
			print('YES')
			exit(0)
print('NO')


l = []
for i in range(4):
	ll = [x for x in input()]
	l.append(ll)
flag = 0
for i in range(3):
	cnt1 = cnt2 = 0
	flag = 0
	for j in range(3):
		cnt = []
		cnt.append(l[i][j])
		cnt.append(l[i][j + 1])
		cnt.append(l[i + 1][j])
		cnt.append(l[i + 1][j + 1])
		cnt1 = cnt.count('#')
		cnt2 = cnt.count('.')
		if cnt1 == 3 or cnt2 == 3 or cnt1 == 4 or (cnt2 == 4):
			flag = 1
			print('YES')
			break
	if flag == 1:
		break
if flag == 0:
	print('NO')


m = []
for i in range(4):
	s = input()
	m.append(s)
res = 'NO'
for i in range(3):
	for j in range(3):
		temp = m[i][j] + m[i + 1][j] + m[i][j + 1] + m[i + 1][j + 1]
		if temp.count('#') != 2:
			res = 'YES'
			break
print(res)


grid = []
for i in range(4):
	grid.append(list(input()))

def valid(r, c):
	if r < 0 or c < 0 or r > 3 or (c > 3):
		return False
	return True

def count(r, c):
	if valid(r - 1, c) and grid[r - 1][c] == '#':
		if valid(r, c - 1) and grid[r][c - 1] == '#' and valid(r - 1, c - 1) and (grid[r - 1][c - 1] == '#'):
			return True
		if valid(r, c + 1) and grid[r][c + 1] == '#' and valid(r - 1, c + 1) and (grid[r - 1][c + 1] == '#'):
			return True
	if valid(r + 1, c) and grid[r + 1][c] == '#':
		if valid(r, c - 1) and grid[r][c - 1] == '#' and valid(r + 1, c - 1) and (grid[r + 1][c - 1] == '#'):
			return True
		if valid(r, c + 1) and grid[r][c + 1] == '#' and valid(r + 1, c + 1) and (grid[r + 1][c + 1] == '#'):
			return True
	return False

def solve():
	for r in range(4):
		for c in range(4):
			if count(r, c):
				return 'YES'
	return 'NO'

def flip():
	for i in range(4):
		for j in range(4):
			grid[i][j] = '#' if grid[i][j] == '.' else '.'
ans = solve()
if ans == 'NO':
	flip()
	ans = solve()
print(ans)


from sys import stdin
import math

def inp():
	return stdin.readline().strip()
ar = []
for i in range(4):
	ar.append(inp())
hashes = 0
dots = 0
for i in range(4):
	for j in range(4):
		if j + 2 > 4 or i + 2 > 4:
			continue
		else:
			hashes = 0
			dots = 0
			for k in range(i, i + 2):
				for l in range(j, j + 2):
					if ar[k][l] == '#':
						hashes += 1
					else:
						dots += 1
					if hashes >= 3 or dots >= 3:
						print('YES')
						exit()
print('NO')


s = []
for i in range(4):
	s.append(input())
c = 0
for i in range(1, 4):
	for j in range(1, 4):
		a = s[i][j] + s[i - 1][j] + s[i - 1][j - 1] + s[i][j - 1]
		if a.count('#') >= 3 or a.count('.') >= 3:
			c = True
			break
if c:
	print('YES')
else:
	print('NO')


matrix = []
for i in range(4):
	l = list(input())
	matrix.append(l)
temp = 0
for j in range(3):
	for k in range(3):
		counth = 0
		countd = 0
		if matrix[j][k] == '#':
			counth += 1
		else:
			countd += 1
		if matrix[j + 1][k + 1] == '#':
			counth += 1
		else:
			countd += 1
		if matrix[j + 1][k] == '#':
			counth += 1
		else:
			countd += 1
		if matrix[j][k + 1] == '#':
			counth += 1
		else:
			countd += 1
		if counth == 4 or countd == 4 or counth == 3 or (countd == 3):
			print('YES')
			temp = 1
			break
	if temp == 1:
		break
if temp == 0:
	print('NO')


s = ''
t = ['####', '....', '###.', '##.#', '#.##', '.###', '...#', '..#.', '.#..', '#...']
for i in range(4):
	s += input()
flag = False
k = 0
for i in range(0, 9, 4):
	for j in range(i, i + 3):
		if s[j] + s[j + 1] + s[j + 4] + s[j + 5] in t:
			flag = True
			break
if flag == True:
	print('YES')
else:
	print('NO')


x = 0
x0 = list(input())
x1 = list(input())
x2 = list(input())
x3 = list(input())
arr = [x0, x1, x2, x3]
flag = False
for i in range(4):
	for j in range(4):
		ty = ''
		tn = ''
		if arr[i][j] == '#':
			ty = '.'
			tn = '#'
		else:
			ty = '#'
			tn = '.'
		arr[i][j] = ty
		if arr[0][0] == arr[0][1] == arr[1][0] == arr[1][1]:
			x = 1
		if arr[0][1] == arr[0][2] == arr[1][1] == arr[1][2]:
			x = 1
		if arr[0][2] == arr[0][3] == arr[1][2] == arr[1][3]:
			x = 1
		if arr[1][0] == arr[1][1] == arr[2][0] == arr[2][1]:
			x = 1
		if arr[1][1] == arr[1][2] == arr[2][1] == arr[2][2]:
			x = 1
		if arr[1][2] == arr[1][3] == arr[2][2] == arr[2][3]:
			x = 1
		if arr[2][0] == arr[2][1] == arr[3][0] == arr[3][1]:
			x = 1
		if arr[2][1] == arr[2][2] == arr[3][1] == arr[3][2]:
			x = 1
		if arr[2][2] == arr[2][3] == arr[3][2] == arr[3][3]:
			x = 1
		arr[i][j] = tn
		if x == 1:
			break
if x == 1:
	print('YES')
else:
	print('NO')


matrix = []
for i in range(4):
	matrix.append([])
	a = input()
	for char in a:
		matrix[i].append(char)

def a():
	e = 0
	g = 0
	if matrix[0][0] == '.' and matrix[0][1] == '.' and (matrix[1][0] == '.') and (matrix[1][1] == '.'):
		e = 1
	elif matrix[0][2] == '.' and matrix[0][3] == '.' and (matrix[1][2] == '.') and (matrix[1][3] == '.'):
		e = 1
	elif matrix[2][0] == '.' and matrix[2][1] == '.' and (matrix[3][0] == '.') and (matrix[3][1] == '.'):
		e = 1
	elif matrix[2][2] == '.' and matrix[2][3] == '.' and (matrix[3][2] == '.') and (matrix[3][3] == '.'):
		e = 1
	elif matrix[0][1] == '.' and matrix[0][2] == '.' and (matrix[1][1] == '.') and (matrix[1][2] == '.'):
		e = 1
	elif matrix[2][1] == '.' and matrix[2][2] == '.' and (matrix[3][1] == '.') and (matrix[3][2] == '.'):
		e = 1
	elif matrix[1][0] == '.' and matrix[1][1] == '.' and (matrix[2][0] == '.') and (matrix[2][1] == '.'):
		e = 1
	elif matrix[1][2] == '.' and matrix[1][3] == '.' and (matrix[2][2] == '.') and (matrix[2][3] == '.'):
		e = 1
	elif matrix[1][1] == '.' and matrix[1][2] == '.' and (matrix[2][1] == '.') and (matrix[2][2] == '.'):
		e = 1
	if e:
		print('YES')
		exit(0)

def b():
	e = 0
	if matrix[0][0] == '#' and matrix[0][1] == '#' and (matrix[1][0] == '#') and (matrix[1][1] == '#'):
		e = 1
	elif matrix[0][2] == '#' and matrix[0][3] == '#' and (matrix[1][2] == '#') and (matrix[1][3] == '#'):
		e = 1
	elif matrix[2][0] == '#' and matrix[2][1] == '#' and (matrix[3][0] == '#') and (matrix[3][1] == '#'):
		e = 1
	elif matrix[2][2] == '#' and matrix[2][3] == '#' and (matrix[3][2] == '#') and (matrix[3][3] == '#'):
		e = 1
	elif matrix[0][1] == '#' and matrix[0][2] == '#' and (matrix[1][1] == '#') and (matrix[1][2] == '#'):
		e = 1
	elif matrix[2][1] == '#' and matrix[2][2] == '#' and (matrix[3][1] == '#') and (matrix[3][2] == '#'):
		e = 1
	elif matrix[1][0] == '#' and matrix[1][1] == '#' and (matrix[2][0] == '#') and (matrix[2][1] == '#'):
		e = 1
	elif matrix[1][2] == '#' and matrix[1][3] == '#' and (matrix[2][2] == '#') and (matrix[2][3] == '#'):
		e = 1
	elif matrix[1][1] == '#' and matrix[1][2] == '#' and (matrix[2][1] == '#') and (matrix[2][2] == '#'):
		e = 1
	if e:
		print('YES')
		exit(0)
a()
b()
for i in range(4):
	for j in range(4):
		if matrix[i][j] == '.':
			matrix[i][j] = '#'
			b()
			matrix[i][j] = '.'
		elif matrix[i][j] == '#':
			matrix[i][j] = '.'
			a()
			matrix[i][j] = '#'
print('NO')


a = []
for i in range(0, 4):
	b = input()
	a.append(list(b))
i = 0
flag = 0
while i < 3:
	j = 0
	while j < 3:
		c1 = 0
		c2 = 0
		if a[i][j] == '#':
			c1 += 1
		else:
			c2 += 1
		if a[i + 1][j] == '#':
			c1 += 1
		else:
			c2 += 1
		if a[i][j + 1] == '#':
			c1 += 1
		else:
			c2 += 1
		if a[i + 1][j + 1] == '#':
			c1 += 1
		else:
			c2 += 1
		if c1 >= 3 or c2 >= 3:
			flag = 1
			break
		j += 1
	i += 1
if flag == 1:
	print('YES')
else:
	print('NO')


paper = [input(), input(), input(), input()]
answer = 'NO'
for i in range(9):
	j = i % 3
	i = i // 3
	counter = 0
	counter += int(paper[i][j] == '.')
	counter += int(paper[i][j + 1] == '.')
	counter += int(paper[i + 1][j] == '.')
	counter += int(paper[i + 1][j + 1] == '.')
	if not counter == 2:
		answer = 'YES'
		break
print(answer)


x = [[i for i in input()] for i in range(4)]
z = 'NO'
for i in range(3):
	for j in range(3):
		f = x[i][j] + x[i][j + 1] + x[i + 1][j] + x[i + 1][j + 1]
		if f.count('#') >= 3 or f.count('.') >= 3:
			z = 'YES'
			break
print(z)


def check(a, smb):
	for i in range(3):
		for j in range(3):
			if a[i][j] == smb and a[i + 1][j] == smb and (a[i][j + 1] == smb) and (a[i + 1][j + 1] == smb):
				return True
	return False
a = []
for i in range(4):
	loc_a = input()
	loc_a = list((str(x) for x in loc_a))
	a.append(loc_a)
res = False
res = check(a, '.')
if res == False:
	res = check(a, '#')
for i in range(4):
	if res == True:
		break
	for j in range(4):
		if a[i][j] == '.':
			a[i][j] = '#'
			res = check(a, '#')
			if res == True:
				break
			a[i][j] = '.'
		else:
			a[i][j] = '.'
			res = check(a, '.')
			if res == True:
				break
			a[i][j] = '#'
if res == True:
	print('YES')
else:
	print('NO')


def main():
	square = []
	for i in range(4):
		square.append([state for state in input()])
	for i in range(3):
		for j in range(3):
			states = [square[i][j], square[i][j + 1], square[i + 1][j], square[i + 1][j + 1]]
			if states.count('#') >= 3 or states.count('.') >= 3:
				print('YES')
				return
	print('NO')
main()


def fn(x):
	if x == '#':
		return 1
	else:
		return 0

def conv(graph):
	filter_size = 2
	dot_filter = [[0, 0], [0, 0]]
	hash_filter = [[1, 1], [1, 1]]
	for i in range(len(graph) - filter_size + 1):
		for j in range(len(graph) - filter_size + 1):
			act = 0
			for k in range(0, filter_size):
				for l in range(0, filter_size):
					act += graph[i + k][j + l] ^ dot_filter[k][l]
			if act <= 1:
				return 'YES'
			act = 0
			for k in range(0, filter_size):
				for l in range(0, filter_size):
					act += graph[i + k][j + l] ^ hash_filter[k][l]
			if act <= 1:
				return 'YES'
	return 'NO'
graph = [list(map(fn, list(input().strip()))) for i in range(4)]
print(conv(graph))


li = []
for _ in range(4):
	li.append(input())
for i in range(3):
	for j in range(3):
		if li[i][j] == '#':
			t = 1
			if li[i + 1][j] == '#':
				t += 1
			if li[i][j + 1] == '#':
				t += 1
			if li[i + 1][j + 1] == '#':
				t += 1
			if t == 4 or t == 3 or t == 1:
				print('YES')
				exit()
		else:
			t = 1
			if li[i + 1][j] == '.':
				t += 1
			if li[i][j + 1] == '.':
				t += 1
			if li[i + 1][j + 1] == '.':
				t += 1
			if t == 4 or t == 3 or t == 1:
				print('YES')
				exit()
print('NO')


import math, sys, os
from io import BytesIO, IOBase
mod = 10 ** 9 + 7
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def minp():
	return map(int, sys.stdin.readline().rstrip().split())

def linp():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def inp():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
s = []
for i in range(4):
	s.append(list(input()))
flag = 0
for i in range(3):
	for j in range(3):
		q = 0
		w = 0
		if s[i][j] == '#':
			q += 1
		else:
			w += 1
		if s[i][j + 1] == '#':
			q += 1
		else:
			w += 1
		if s[i + 1][j] == '#':
			q += 1
		else:
			w += 1
		if s[i + 1][j + 1] == '#':
			q += 1
		else:
			w += 1
		if q >= 3 or w >= 3:
			flag = 1
			break
	if flag:
		break
if flag:
	print('YES')
else:
	print('NO')


s1 = input('')
s2 = input('')
s3 = input('')
s4 = input('')
s1.split()
s2.split()
s3.split()
s4.split()
array = []
array.append(s1)
array.append(s2)
array.append(s3)
array.append(s4)
cond = False
for i in range(3):
	for j in range(3):
		count1 = 0
		count2 = 0
		if array[i][j] == '#':
			count1 += 1
		else:
			count2 += 1
		if array[i][j + 1] == '#':
			count1 += 1
		else:
			count2 += 1
		if array[i + 1][j] == '#':
			count1 += 1
		else:
			count2 += 1
		if array[i + 1][j + 1] == '#':
			count1 += 1
		else:
			count2 += 1
		if count1 >= 3 or count2 >= 3:
			cond = True
			break
if cond:
	print('YES')
else:
	print('NO')


a = [input() for _ in range(4)]
flag = 0
for i in range(0, 3):
	for j in range(0, 3):
		s = a[i][j] + a[i][j + 1] + a[i + 1][j] + a[i + 1][j + 1]
		if s.count('#') == 0 or s.count('#') == 1 or s.count('#') == 3 or (s.count('#') == 4):
			print('YES')
			flag = 1
			exit()
if flag == 0:
	print('NO')


a = []
for i in range(4):
	a.append(input())

def ck(arr):
	for i in range(3):
		for j in range(3):
			if a[i][j] == a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
				return 'YES'
			elif a[i][j] == a[i][j + 1] == a[i + 1][j]:
				return 'YES'
			elif a[i][j] == a[i][j + 1] == a[i + 1][j + 1]:
				return 'YES'
			elif a[i][j] == a[i + 1][j] == a[i + 1][j + 1]:
				return 'YES'
			elif a[i][j + 1] == a[i + 1][j] == a[i + 1][j + 1]:
				return 'YES'
	return 'NO'
print(ck(a))


a = []
for _ in range(4):
	a.append(input())
flag = 0
for i in range(3):
	for j in range(3):
		s = [a[i][j], a[i + 1][j], a[i][j + 1], a[i + 1][j + 1]]
		if s.count('.') >= 3 or s.count('#') >= 3:
			flag = 1
			break
if flag == 1:
	print('YES')
else:
	print('NO')


a = []
done = False
for i in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		now = [a[i][j], a[i][j + 1], a[i + 1][j], a[i + 1][j + 1]]
		if now.count('#') >= 3 or now.count('.') >= 3:
			print('YES')
			done = True
			break
	if done == True:
		break
else:
	print('NO')


l = []
for _ in range(4):
	l.append(input())
for i in range(len(l)):
	for j in range(4):
		if j == 3 or i == 3:
			break
		(nl, has, dot) = ([], 0, 0)
		nl += [l[i][j], l[i][j + 1], l[i + 1][j], l[i + 1][j + 1]]
		for e in nl:
			if e == '#':
				has += 1
			elif e == '.':
				dot += 1
		if has == 3 and dot == 1 or (has == 1 and dot == 3) or (has == 0 and dot == 4) or (has == 4 and dot == 0):
			print('YES')
			exit()
print('NO')


s = []
suc = 0
for i in range(4):
	s.append(input())
for i in range(3):
	for j in range(3):
		if s[i][j].count('#') + s[i + 1][j].count('#') + s[i][j + 1].count('#') + s[i + 1][j + 1].count('#') != 2:
			suc = 1
if suc == 1:
	print('YES')
else:
	print('NO')


field = [input() for i in range(4)]
for i in range(3):
	for j in range(3):
		s = ''
		for a in range(2):
			for b in range(2):
				s += field[i + a][j + b]
		if s.count('.') != 2:
			print('YES')
			exit(0)
print('NO')


walls = []
for i in range(4):
	walls.append(list(input()))
ans = 'NO'
for i in range(3):
	for j in range(3):
		if (walls[i][j:j + 2] + walls[i + 1][j:j + 2]).count('#') != 2:
			ans = 'YES'
			break
print(ans)


lst = [input() for _ in range(4)]
yes = False
for i in range(3):
	for j in range(3):
		cc = lst[i][j]
		c = 1
		if i + 1 < 4 and lst[i + 1][j] == cc:
			c += 1
		if j + 1 < 4 and lst[i][j + 1] == cc:
			c += 1
		if j + 1 < 4 and i + 1 < 4 and (lst[i + 1][j + 1] == cc):
			c += 1
		if c >= 3:
			yes = True
			break
	if c >= 3:
		break
for i in range(3, 0, -1):
	for j in range(3, 0, -1):
		cc = lst[i][j]
		c = 1
		if i - 1 >= 0 and lst[i - 1][j] == cc:
			c += 1
		if j - 1 >= 0 and lst[i][j - 1] == cc:
			c += 1
		if j - 1 >= 0 and i - 1 >= 0 and (lst[i - 1][j - 1] == cc):
			c += 1
		if c >= 3:
			yes = True
			break
	if c >= 3:
		break
if yes:
	print('YES')
else:
	print('NO')


a = []
for i in range(4):
	a = a + list(input())
c = 0
b = []
for i in a:
	if i == '.':
		b.append(0)
	else:
		b.append(1)
for i in range(0, 11):
	if i % 4 == 3:
		i = i + 1
	elif b[i] + b[i + 1] + b[i + 4] + b[i + 5] != 2:
		c = 1
if c == 0:
	print('NO')
else:
	print('YES')


ls = []
for i in range(4):
	s = list(input())
	ls.append(s)
flag = 0
for i in range(3):
	if flag == 1:
		break
	for j in range(3):
		count = 0
		if ls[i][j] == '.':
			count += 1
		if ls[i + 1][j] == '.':
			count += 1
		if ls[i][j + 1] == '.':
			count += 1
		if ls[i + 1][j + 1] == '.':
			count += 1
		if count == 1 or count == 3 or count == 0 or (count == 4):
			print('YES')
			flag = 1
			break
if flag == 0:
	print('NO')


l = []
for i in range(4):
	l.append(input())
for i in range(3):
	(x, y) = (l[i], l[i + 1])
	for i in range(3):
		e = [0, 0]
		if x[i] == '#':
			e[0] += 1
		else:
			e[1] += 1
		if x[i + 1] == '#':
			e[0] += 1
		else:
			e[1] += 1
		if y[i] == '#':
			e[0] += 1
		else:
			e[1] += 1
		if y[i + 1] == '#':
			e[0] += 1
		else:
			e[1] += 1
		if e[0] != e[1]:
			print('YES')
			quit()
print('NO')


str1 = input()
for i in range(3):
	str2 = input()
	for j in range(3):
		exp1 = str1[j:j + 2].count('#') + str2[j:j + 2].count('#')
		exp2 = 4 - exp1
		if exp1 > 2 or exp2 > 2:
			print('YES')
			exit()
	str1 = str2
print('NO')


a = list(input())
b = list(input())
c = list(input())
d = list(input())

def square(a, b, c, d):
	iq = 0
	for i in range(0, 3):
		if a[i] == a[i + 1] == b[i] or a[i] == a[i + 1] == b[i + 1]:
			iq += 1
		elif b[i] == b[i + 1] == a[i] or b[i] == b[i + 1] == a[i + 1]:
			iq += 1
		elif b[i] == b[i + 1] == c[i] or b[i] == b[i + 1] == c[i + 1]:
			iq = 1
		elif c[i] == c[i + 1] == b[i] or c[i] == c[i + 1] == b[i + 1]:
			iq = 1
		elif c[i] == c[i + 1] == d[i] or c[i] == c[i + 1] == d[i + 1]:
			iq = 1
		elif d[i] == d[i + 1] == c[i] or d[i] == d[i + 1] == c[i + 1]:
			iq += 1
		else:
			iq += 0
	if iq > 0:
		print('YES')
	else:
		print('NO')
square(a, b, c, d)


r1 = input()
r2 = input()
r3 = input()
r4 = input()
for i in range(2):
	if r1[i] == r1[i + 1] == r2[i] or r1[i] == r2[i] == r2[i + 1]:
		print('YES')
		exit()
	if r2[i] == r2[i + 1] == r3[i] or r2[i] == r3[i] == r3[i + 1]:
		print('YES')
		exit()
	if r3[i] == r3[i + 1] == r4[i] or r3[i] == r4[i] == r4[i + 1]:
		print('YES')
		exit()
for i in range(3, 1, -1):
	if r1[i] == r1[i - 1] == r2[i] or r1[i] == r2[i] == r2[i - 1]:
		print('YES')
		exit()
	if r2[i] == r2[i - 1] == r3[i] or r2[i] == r3[i] == r3[i - 1]:
		print('YES')
		exit()
	if r3[i] == r3[i - 1] == r4[i] or r3[i] == r4[i] == r4[i - 1]:
		print('YES')
		exit()
print('NO')


s = str(input())
s1 = str(input())
s2 = str(input())
s3 = str(input())
l = []
flag = 0
l.append(s[0])
l.append(s[1])
l.append(s1[0])
l.append(s1[1])
for i in range(0, len(l)):
	if l.count('#') > 2 or l.count('.') > 2:
		flag = 1
l1 = []
l1.append(s[1])
l1.append(s[2])
l1.append(s1[1])
l1.append(s1[2])
for i in range(0, len(l1)):
	if l1.count('#') > 2 or l1.count('.') > 2:
		flag = 1
l2 = []
l2.append(s[2])
l2.append(s[3])
l2.append(s1[2])
l2.append(s1[3])
for i in range(0, len(l2)):
	if l2.count('#') > 2 or l2.count('.') > 2:
		flag = 1
l3 = []
l3.append(s1[0])
l3.append(s1[1])
l3.append(s2[0])
l3.append(s2[1])
for i in range(0, len(l3)):
	if l3.count('#') > 2 or l3.count('.') > 2:
		flag = 1
l4 = []
l4.append(s1[1])
l4.append(s1[2])
l4.append(s2[1])
l4.append(s2[2])
for i in range(0, len(l4)):
	if l4.count('#') > 2 or l4.count('.') > 2:
		flag = 1
l5 = []
l5.append(s1[2])
l5.append(s1[3])
l5.append(s2[2])
l5.append(s2[3])
for i in range(0, len(l5)):
	if l5.count('#') > 2 or l5.count('.') > 2:
		flag = 1
l6 = []
l6.append(s2[0])
l6.append(s2[1])
l6.append(s3[0])
l6.append(s3[1])
for i in range(0, len(l6)):
	if l6.count('#') > 2 or l6.count('.') > 2:
		flag = 1
l7 = []
l7.append(s2[1])
l7.append(s2[2])
l7.append(s3[1])
l7.append(s3[2])
for i in range(0, len(l7)):
	if l7.count('#') > 2 or l7.count('.') > 2:
		flag = 1
l8 = []
l8.append(s2[2])
l8.append(s2[3])
l8.append(s3[2])
l8.append(s3[3])
for i in range(0, len(l8)):
	if l8.count('#') > 2 or l8.count('.') > 2:
		flag = 1
if flag == 1:
	print('YES')
else:
	print('NO')


def IQTest(grid):
	for i in range(3):
		for j in range(3):
			blacks = int(grid[i][j] == '#')
			blacks += int(grid[i + 1][j] == '#')
			blacks += int(grid[i][j + 1] == '#')
			blacks += int(grid[i + 1][j + 1] == '#')
			whites = 4 - blacks
			if blacks >= 3 or whites >= 3:
				print('YES')
				return
	print('NO')
grid = []
for i in range(4):
	grid.append(input())
IQTest(grid)


matrix = []
for i in range(4):
	matrix.append(input())

def solve():
	for i in range(3):
		for j in range(3):
			s = 0
			s += 1 if matrix[i][j] == '#' else 0
			s += 1 if matrix[i + 1][j] == '#' else 0
			s += 1 if matrix[i][j + 1] == '#' else 0
			s += 1 if matrix[i + 1][j + 1] == '#' else 0
			if s >= 3:
				return 'YES'
			s = 0
			s += 1 if matrix[i][j] == '.' else 0
			s += 1 if matrix[i + 1][j] == '.' else 0
			s += 1 if matrix[i][j + 1] == '.' else 0
			s += 1 if matrix[i + 1][j + 1] == '.' else 0
			if s >= 3:
				return 'YES'
	return 'NO'
print(solve())


l = []
for i in range(4):
	l.append(list(input()))
c1 = 0
if l[0][1] == '#':
	c = 1
	if l[0][2] == '#':
		c += 1
	if l[1][1] == '#':
		c += 1
	if l[1][2] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[0][1] == '#':
	c = 1
	if l[0][0] == '#':
		c += 1
	if l[1][1] == '#':
		c += 1
	if l[1][0] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[0][2] == '#':
	c = 1
	if l[0][3] == '#':
		c += 1
	if l[1][2] == '#':
		c += 1
	if l[1][3] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[1][1] == '#':
	c = 1
	if l[1][2] == '#':
		c += 1
	if l[2][1] == '#':
		c += 1
	if l[2][2] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[1][1] == '#':
	c = 1
	if l[1][0] == '#':
		c += 1
	if l[2][1] == '#':
		c += 1
	if l[2][0] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[1][2] == '#':
	c = 1
	if l[1][3] == '#':
		c += 1
	if l[2][2] == '#':
		c += 1
	if l[2][3] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[2][1] == '#':
	c = 1
	if l[2][0] == '#':
		c += 1
	if l[3][1] == '#':
		c += 1
	if l[3][0] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[2][1] == '#':
	c = 1
	if l[2][2] == '#':
		c += 1
	if l[3][1] == '#':
		c += 1
	if l[3][2] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
if l[2][2] == '#':
	c = 1
	if l[2][3] == '#':
		c += 1
	if l[3][2] == '#':
		c += 1
	if l[3][3] == '#':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c1 = 1
c2 = 0
if l[0][1] == '.':
	c = 1
	if l[0][2] == '.':
		c += 1
	if l[1][1] == '.':
		c += 1
	if l[1][2] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[0][1] == '.':
	c = 1
	if l[0][0] == '.':
		c += 1
	if l[1][1] == '.':
		c += 1
	if l[1][0] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[0][2] == '.':
	c = 1
	if l[0][3] == '.':
		c += 1
	if l[1][2] == '.':
		c += 1
	if l[1][3] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[1][1] == '.':
	c = 1
	if l[1][2] == '.':
		c += 1
	if l[2][1] == '.':
		c += 1
	if l[2][2] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[1][1] == '.':
	c = 1
	if l[1][0] == '.':
		c += 1
	if l[2][1] == '.':
		c += 1
	if l[2][0] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[1][2] == '.':
	c = 1
	if l[1][3] == '.':
		c += 1
	if l[2][2] == '.':
		c += 1
	if l[2][3] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[2][1] == '.':
	c = 1
	if l[2][0] == '.':
		c += 1
	if l[3][1] == '.':
		c += 1
	if l[3][0] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[2][1] == '.':
	c = 1
	if l[2][2] == '.':
		c += 1
	if l[3][1] == '.':
		c += 1
	if l[3][2] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if l[2][2] == '.':
	c = 1
	if l[2][3] == '.':
		c += 1
	if l[3][2] == '.':
		c += 1
	if l[3][3] == '.':
		c += 1
	if c == 3 or c == 4 or c == 1:
		c2 = 1
if c1 == 1 or c2 == 1:
	print('YES')
else:
	print('NO')


l = []
for i in range(4):
	l.append(input())
a = []
for j in range(3):
	for i in range(3):
		a.append(l[j][i:i + 2] + l[j + 1][i:i + 2])
ans = 'NO'
for i in range(9):
	if a[i].count('#') != 2:
		ans = 'YES'
print(ans)


l = []
answer = 'NO'
for i in range(4):
	l.append(input())
for a in range(3):
	for b in range(3):
		if (l[a][b:b + 2] + l[a + 1][b:b + 2]).count('#') != 2:
			answer = 'YES'
			break
print(answer)


m = [[''] * 6 for i in range(6)]
for i in range(1, 5):
	m[i] = [''] + list(input()) + ['']
for i in range(1, 5):
	for j in range(1, 5):
		if m[i - 1][j] == '#' and m[i - 1][j - 1] == '#' and (m[i][j - 1] == '#') or (m[i - 1][j] == '.' and m[i - 1][j - 1] == '.' and (m[i][j - 1] == '.')) or (m[i][j - 1] == '#' and m[i + 1][j - 1] == '#' and (m[i + 1][j] == '#')) or (m[i][j - 1] == '.' and m[i + 1][j - 1] == '.' and (m[i + 1][j] == '.')) or (m[i][j + 1] == '#' and m[i - 1][j + 1] == '#' and (m[i - 1][j] == '#')) or (m[i][j + 1] == '.' and m[i - 1][j + 1] == '.' and (m[i - 1][j] == '.')) or (m[i][j + 1] == '#' and m[i + 1][j + 1] == '#' and (m[i + 1][j] == '#')) or (m[i][j + 1] == '.' and m[i + 1][j + 1] == '.' and (m[i + 1][j] == '.')):
			print('YES')
			return
print('NO')


import io
import os

def main():
	g = [[] for _ in range(4)]
	for i in range(4):
		g[i] = input()
	ok = False
	for i in range(3):
		for j in range(3):
			x = [g[i][j], g[i][j + 1], g[i + 1][j], g[i + 1][j + 1]]
			if x.count('#') > 2 or x.count('.') > 2:
				ok = True
				break
		if ok:
			break
	print('YES' if ok else 'NO')
main()


s = []
for i in range(4):
	s.append(input())
f = False
for i in range(3):
	for j in range(3):
		s1 = s[i][j:j + 2] + s[i + 1][j:j + 2]
		if s1.count('#') != s1.count('.'):
			f = True
			print('YES')
			break
	if f:
		break
if not f:
	print('NO')


a = [input(), input(), input(), input()]
c = 0
for i in range(3):
	for j in range(3):
		if a[i][j] == a[i][j + 1] or a[i + 1][j] == a[i + 1][j + 1]:
			if a[i + 1][j] == a[i][j] or a[i + 1][j + 1] == a[i][j + 1]:
				c = 1
if c == 1:
	print('YES')
else:
	print('NO')


matrix = []
for _ in range(4):
	line = [str(i) for i in input()]
	matrix.append(line)
for i in range(3):
	for j in range(3):
		left_top = matrix[i][j]
		right_top = matrix[i][j + 1]
		left_bottom = matrix[i + 1][j]
		right_bottom = matrix[i + 1][j + 1]
		if left_top == right_top and right_top == left_bottom and (left_bottom == right_bottom):
			print('YES')
			exit(0)
		lst = [left_top, right_top, left_bottom, right_bottom]
		if lst.count('#') == 3 or lst.count('.') == 3:
			print('YES')
			exit(0)
print('NO')


matrix = []
for _ in range(4):
	row = list(input())
	matrix.append(row)
flage = 1
for i in range(1, 4):
	for j in range(1, 4):
		if flage:
			(black, white) = (0, 0)
			for (x, y) in [[0, 0], [-1, 0], [0, -1], [-1, -1]]:
				if matrix[i + x][j + y] == '#':
					black += 1
				else:
					white += 1
			if black >= 3 or white >= 3:
				print('YES')
				flage = 0
if flage:
	print('NO')


a = []
for x in range(4):
	a.append(list(input()))
for i in range(3):
	for j in range(3):
		if (a[i][j] == '.') + (a[i + 1][j] == '.') + (a[i][j + 1] == '.') + (a[i + 1][j + 1] == '.') != 2:
			print('YES')
			exit(0)
print('NO')


l = [list(input()) for i in range(4)]

def fn(l):
	for i in range(3):
		for j in range(3):
			b = w = 0
			if l[i][j] == '#':
				b += 1
			else:
				w += 1
			if l[i + 1][j] == '#':
				b += 1
			else:
				w += 1
			if l[i][j + 1] == '#':
				b += 1
			else:
				w += 1
			if l[i + 1][j + 1] == '#':
				b += 1
			else:
				w += 1
			if b != w:
				return 'YES'
	return 'NO'
print(fn(l))


x = []
n = 4
for i in range(n):
	x.append(list(input()))
k = False
for i in range(1, n):
	for j in range(1, n):
		c = 0
		if x[i][j] == '#':
			c += 1
		if x[i - 1][j] == '#':
			c += 1
		if x[i][j - 1] == '#':
			c += 1
		if x[i - 1][j - 1] == '#':
			c += 1
		if c != 2:
			k = True
			break
if k:
	print('YES')
else:
	print('NO')


l = []
for i in range(4):
	l.append(list(input()))
ans = 'NO'
for i in range(4):
	for j in range(4):
		count_l = 0
		count_r = 0
		count_u = 0
		count_d = 0
		if l[i][j] == '#':
			try:
				if l[i][j + 1] == '#' and j < 3:
					count_r += 1
			except IndexError:
				pass
			try:
				if l[i][j - 1] == '#' and j > 0:
					count_l += 1
			except IndexError:
				pass
			try:
				if l[i - 1][j] == '#' and i > 0:
					count_u += 1
			except IndexError:
				pass
			try:
				if l[i + 1][j] == '#' and i < 3:
					count_d += 1
			except IndexError:
				pass
		else:
			try:
				if l[i][j + 1] == '.' and j < 3:
					count_r += 1
			except IndexError:
				pass
			try:
				if l[i][j - 1] == '.' and j > 0:
					count_l += 1
			except IndexError:
				pass
			try:
				if l[i - 1][j] == '.' and i > 0:
					count_u += 1
			except IndexError:
				pass
			try:
				if l[i + 1][j] == '.' and i < 3:
					count_d += 1
			except IndexError:
				pass
		if (count_l == 1 or count_r == 1) and (count_u == 1 or count_d == 1):
			ans = 'YES'
			break
	if ans == 'YES':
		break
print(ans)


n = 4
grid = []

def is_valid(r, c):
	return r >= 0 and c >= 0 and (r < 4) and (c < 4)

def test(r, c):
	if is_valid(r + 1, c) and is_valid(r, c + 1) and is_valid(r + 1, c + 1) and (grid[r + 1][c] == grid[r][c + 1] == grid[r + 1][c + 1]):
		return True
	if is_valid(r, c - 1) and is_valid(r + 1, c) and is_valid(r + 1, c - 1) and (grid[r][c - 1] == grid[r + 1][c] == grid[r + 1][c - 1]):
		return True
	if is_valid(r - 1, c) and is_valid(r, c + 1) and is_valid(r - 1, c + 1) and (grid[r - 1][c] == grid[r][c + 1] == grid[r - 1][c + 1]):
		return True
	if is_valid(r, c - 1) and is_valid(r - 1, c) and is_valid(r - 1, c - 1) and (grid[r][c - 1] == grid[r - 1][c] == grid[r - 1][c - 1]):
		return True

def solve():
	for i in range(n):
		grid.append(input())
	for i in range(n):
		for j in range(n):
			if test(i, j):
				print('YES')
				return
	print('NO')
solve()


m = input()
n = input()
o = input()
p = input()
l = [m, n, o, p]
c = 0
for i in range(3):
	j = 0
	while j < 3:
		s = l[i][j:j + 2] + l[i + 1][j:j + 2]
		if s.count('#') == 3 or s.count('#') == 1 or s.count('#') == 4 or (s.count('#') == 0):
			c = 1
			break
		j += 1
	if c:
		print('YES')
		break
if not c:
	print('NO')


lst = []
for i in range(4):
	lst.append(input())
flag = False
for i in range(3):
	for j in range(3):
		sub = [lst[i][j], lst[i + 1][j], lst[i][j + 1], lst[i + 1][j + 1]]
		if sub.count('#') == 3 or sub.count('.') == 3 or sub.count('#') == 4 or (sub.count('.') == 4):
			flag = True
			break
print('YES' if flag else 'NO')


import sys

def test(colors):
	for i in range(len(colors) - 1):
		for j in range(len(colors) - 1):
			square = (colors[i][j], colors[i + 1][j], colors[i][j + 1], colors[i + 1][j + 1])
			if sum(square) != 2:
				return 'YES'
	return 'NO'

def initial(colors):
	for i in range(4):
		yield [0 if j == '#' else 1 for j in colors[i]]
colors = [sys.stdin.readline() for i in range(4)]
colors = list(initial(colors))
print(test(colors))


def isSquares(arr):
	for i in range(0, 3):
		for j in range(0, 3):
			n = [arr[i][j], arr[i][j + 1], arr[i + 1][j], arr[i + 1][j + 1]]
			if n.count('.') == 3 and n.count('#') == 1:
				return True
			elif n.count('#') == 3 and n.count('.') == 1:
				return True
			elif n.count('#') == 4 or n.count('.') == 4:
				return True
	return False
arr = []
for i in range(0, 4):
	k = list(input())
	arr.append(k)
if isSquares(arr):
	print('YES')
else:
	print('NO')


mat = []
for i in range(4):
	s = input()
	mat.append(s)
boo = True
for i in range(1, 4):
	b = 0
	w = 0
	for j in range(1, 4):
		if mat[i][j - 1] == '.':
			b += 1
		else:
			w += 1
		if mat[i - 1][j] == '#':
			w += 1
		else:
			b += 1
		if mat[i - 1][j - 1] == '.':
			b += 1
		else:
			w += 1
		if mat[i][j] == '.':
			b += 1
		else:
			w += 1
		if b == 1 or w == 1 or b == 0 or (w == 0):
			boo = False
		b = 0
		w = 0
if boo:
	print('NO')
else:
	print('YES')


a = []
for _ in range(4):
	b = list(input())
	a.append(b)
f = 0
for x in range(0, 4):
	if f == 1:
		break
	if x == 3:
		for y in range(0, 3):
			if a[x][y + 1] == a[x][y] and a[x - 1][y] == a[x][y] or (a[x - 1][y + 1] == a[x][y] and a[x][y + 1] == a[x][y]) or (a[x - 1][y + 1] == a[x][y] and a[x - 1][y] == a[x][y]):
				print('YES')
				f = 1
				break
	else:
		for y in range(0, 3):
			if a[x][y + 1] == a[x][y] and a[x + 1][y] == a[x][y] or (a[x + 1][y + 1] == a[x][y] and a[x][y + 1] == a[x][y]) or (a[x + 1][y + 1] == a[x][y] and a[x + 1][y] == a[x][y]):
				print('YES')
				f = 1
				break
if f == 0:
	print('NO')


matrix = [[] for i in range(4)]
for i in range(4):
	matrix[i] = input()

def test(matrix):
	for i in range(3):
		for j in range(3):
			counter = 0
			if matrix[i][j] == matrix[i][j + 1]:
				counter += 1
			if matrix[i][j] == matrix[i + 1][j]:
				counter += 1
			if matrix[i][j] == matrix[i + 1][j + 1]:
				counter += 1
			if counter != 1:
				return True
	return False
print('YES' if test(matrix) else 'NO')


a = [''] * 4
for i in range(4):
	a[i] = input()
x = 0
for i in range(4):
	for j in range(4):
		try:
			if a[i][j] == a[i][j + 1] and a[i][j] == a[i - 1][j] or (a[i][j] == a[i][j + 1] and a[i][j] == a[i - 1][j + 1]) or (a[i][j] == a[i][j + 1] and a[i][j] == a[i - 1][j + 1]) or (a[i][j] == a[i][j + 1] and a[i][j] == a[i + 1][j]) or (a[i][j] == a[i][j + 1] and a[i][j] == a[i + 1][j + 1]):
				x = 1
				break
		except:
			pass
if x:
	print('YES')
else:
	print('NO')


def f(x, y):
	z = [a[x][y + 1], a[x - 1][y], a[x - 1][y + 1]].count(a[x][y])
	if z >= 2 or z == 0:
		return True
	b = [a[x][y + 1], a[x + 1][y], a[x + 1][y + 1]].count(a[x][y])
	if b >= 2 or b == 0:
		return True
	w = [a[x][y - 1], a[x - 1][y], a[x - 1][y - 1]].count(a[x][y])
	if w >= 2 or w == 0:
		return True
	t = [a[x][y - 1], a[x + 1][y], a[x + 1][y - 1]].count(a[x][y])
	if t >= 2 or t == 0:
		return True
	return False
a = [list(input()) for i in range(4)]
c = 0
for j in range(1, 3):
	if c == 1:
		break
	else:
		for k in range(1, 3):
			if f(j, k):
				c = 1
if c == 1:
	print('YES')
else:
	print('NO')


mat = [[''] * 1 for _ in range(4)]
for i in range(4):
	temp = input()
	mat[i] = temp
printed = False
for i in range(3):
	if printed:
		break
	has = 0
	dots = 0
	for j in range(1, 4):
		if mat[i][j] == '#':
			has += 1
		else:
			dots += 1
		if mat[i][j - 1] == '#':
			has += 1
		else:
			dots += 1
		if mat[i + 1][j] == '#':
			has += 1
		else:
			dots += 1
		if mat[i + 1][j - 1] == '#':
			has += 1
		else:
			dots += 1
		if abs(has - dots) >= 2:
			print('YES')
			printed = True
			break
if not printed:
	print('NO')


paper = []
for i in range(4):
	paper.append(input())
flag = True
for i in range(3):
	for j in range(3):
		square = paper[i][j] + paper[i][j + 1] + paper[i + 1][j] + paper[i + 1][j + 1]
		if square.count('#') in [0, 1, 3, 4]:
			flag = False
			print('YES')
			break
	if not flag:
		break
if flag:
	print('NO')


l = []
for i in range(4):
	l2 = input()
	l1 = []
	for j in range(4):
		l1.append(l2[j])
	l.append(l1)
r = 0
for i in range(3):
	for j in range(3):
		if l[i][j] == l[i][j + 1]:
			if l[i][j] == l[i + 1][j] or l[i][j] == l[i + 1][j + 1]:
				r = 1
				break
				break
for i in range(3):
	for j in range(4):
		if l[i][j] == l[i + 1][j]:
			if j != 3 and l[i][j] == l[i + 1][j + 1] or (j != 0 and l[i][j] == l[i + 1][j - 1]):
				r = 1
				break
				break
if r == 0:
	print('NO')
else:
	print('YES')


def check_square(square):
	flatten = square[0] + square[1]
	count_hash = flatten.count('#')
	count_dot = flatten.count('.')
	if count_hash == 3 or count_hash == 1:
		return 'YES'
	elif count_hash == 4 or count_hash == 0:
		return 'YES'
	else:
		return 'NO'

def io():
	sq = []
	move = 0
	for i in range(4):
		tmp = list(input())
		sq.append(tmp)
	return sq

def solve():
	sq = io()
	row_1 = 0
	row_2 = 1
	ans = 'NO'
	move = 1
	for i in range(3):
		row_1 = i - 1
		row_2 = i
		for j in range(3):
			tmp_sq = []
			tmp_sq.append([sq[row_1][j], sq[row_1][j + 1]])
			tmp_sq.append([sq[row_2][j], sq[row_2][j + 1]])
			ans = check_square(tmp_sq)
			if ans == 'YES':
				move = 0
				break
		if move == 0:
			break
	print(ans)
solve()


matriz = [list(map(str, input())) for i in range(4)]
flag = False
for i in range(4):
	for j in range(4):
		try:
			m = matriz
			sqr = [m[i][j], m[i][j + 1], m[i + 1][j], m[i + 1][j + 1]]
			if sqr.count('#') >= 3 or sqr.count('.') >= 3:
				flag = True
		except:
			continue
if flag:
	print('YES')
else:
	print('NO')


a = []
for _ in range(4):
	a.append(input())
ok = False
for i in range(3):
	for j in range(3):
		b = 0
		w = 0
		for k in range(2):
			for l in range(2):
				if a[i + k][j + l] == '.':
					w += 1
				else:
					b += 1
		if b == 4 or w == 4 or b == 1 or (w == 1):
			ok = True
			break
	if ok:
		break
print('YES' if ok else 'NO')


import sys

def ck(a):
	for i in range(3):
		for j in range(3):
			if a[i][j] == a[i + 1][j] == a[i][j + 1] == a[i + 1][j + 1]:
				return True
	return False
a = []
for i in range(4):
	a.append(list(input()))
for i in range(4):
	for j in range(4):
		if a[i][j] == '#':
			a[i][j] = '.'
			if ck(a):
				print('YES')
				sys.exit()
			a[i][j] = '#'
		else:
			a[i][j] = '#'
			if ck(a):
				print('YES')
				sys.exit()
			a[i][j] = '.'
print('NO')


import sys
input = sys.stdin.readline
board = []
for i in range(4):
	board.append(input()[:-1])
get = False
for i in range(3):
	for j in range(3):
		cnt = board[i][j:j + 2].count('#') + board[i + 1][j:j + 2].count('#')
		if cnt >= 3 or cnt <= 1:
			get = True
			break
	if get:
		break
if get:
	print('YES')
else:
	print('NO')


a = [[], [], [], []]
c = []
z = '#'
y = '.'
for i in range(4):
	b = input()
	for j in b:
		a[i].append(j)
s1 = [a[0][0], a[0][1], a[1][0], a[1][1]]
s2 = [a[0][2], a[0][3], a[1][2], a[1][3]]
s3 = [a[2][0], a[2][1], a[3][0], a[3][1]]
s4 = [a[2][2], a[2][3], a[3][2], a[3][3]]
s5 = [a[0][1], a[0][2], a[1][1], a[1][2]]
s6 = [a[2][1], a[2][2], a[3][1], a[3][2]]
s7 = [a[1][0], a[1][1], a[2][0], a[2][1]]
s8 = [a[1][2], a[1][3], a[2][2], a[2][3]]
s9 = [a[1][1], a[1][2], a[2][1], a[2][2]]
c.append(s1)
c.append(s2)
c.append(s3)
c.append(s4)
c.append(s5)
c.append(s6)
c.append(s7)
c.append(s8)
c.append(s9)
for i in range(9):
	if c[i].count(z) >= 3 or c[i].count(y) >= 3:
		print('YES')
		exit()
print('NO')


arr = [list(input()) for z in range(4)]
flag = 0
for i in range(0, 3):
	for j in range(0, 3):
		l = j
		r = j + 1
		t = i
		b = i + 1
		hashc = 0
		dotc = 0
		if arr[l][t] == '#':
			hashc += 1
		else:
			dotc += 1
		if arr[l][b] == '#':
			hashc += 1
		else:
			dotc += 1
		if arr[r][t] == '#':
			hashc += 1
		else:
			dotc += 1
		if arr[r][b] == '#':
			hashc += 1
		else:
			dotc += 1
		if (dotc == 3) & (hashc == 1):
			print('YES')
			flag = 1
			break
		elif (dotc == 4) & (hashc == 0):
			print('YES')
			flag = 2
			break
		elif (dotc == 1) & (hashc == 3):
			print('YES')
			flag = 3
			break
		elif (dotc == 0) & (hashc == 4):
			print('YES')
			flag = 4
			break
	if flag >= 1:
		break
if flag == 0:
	print('NO')


arr = []
for _ in range(4):
	arr.append(list(input()))
for k in range(3):
	for kk in range(3):
		arr100 = []
		arr100.append(arr[k][kk])
		arr100.append(arr[k][kk + 1])
		arr100.append(arr[k + 1][kk])
		arr100.append(arr[k + 1][kk + 1])
		zz = arr100.count('#')
		zzz = arr100.count('.')
		if zz == 4 or zzz == 4 or (zz == 3 and zzz == 1) or (zz == 1 and zzz == 3):
			print('YES')
			exit()
print('NO')


def main():
	arr = []
	cnt = 0
	for i in range(4):
		string = str(input())
		arr.append(string)
	for i in range(len(arr) - 1):
		for j in range(3):
			cnt = 0
			if arr[i][j] == '#':
				cnt += 1
			if arr[i + 1][j] == '#':
				cnt += 1
			if arr[i][j + 1] == '#':
				cnt += 1
			if arr[i + 1][j + 1] == '#':
				cnt += 1
			if cnt != 2:
				print('YES')
				return
	print('NO')
	return
main()


a = []
for i in range(4):
	a.append(list(input()))
for i in range(3):
	for j in range(3):
		l = 0
		m = 0
		if a[i][j] == '#':
			l += 1
		else:
			m += 1
		if a[i + 1][j] == '#':
			l += 1
		else:
			m += 1
		if a[i][j + 1] == '#':
			l += 1
		else:
			m += 1
		if a[i + 1][j + 1] == '#':
			l += 1
		else:
			m += 1
		if min(l, m) <= 1:
			print('YES')
			exit(0)
print('NO')


ans = []
for i in range(4):
	ans.append(list(input()))
cnt = 0
for (index, x) in enumerate(ans):
	if index == 3:
		break
	for (times, z) in enumerate(x):
		if times == 3:
			break
		temp = [z, x[times + 1], ans[index + 1][times], ans[index + 1][times + 1]]
		dots = temp.count('.')
		hashes = temp.count('#')
		if hashes <= 1 or dots <= 1:
			print('YES')
			exit()
print('NO')


matrix = [''] * 4
for i in range(4):
	matrix[i] = input()

def checker(symbol):
	opposite = '#' if symbol == '.' else '.'
	for i in range(3):
		for j in range(3):
			missing = 0
			if matrix[i][j] == symbol:
				if matrix[i + 1][j] != symbol:
					missing += 1
				if matrix[i][j + 1] != symbol:
					missing += 1
				if matrix[i + 1][j + 1] != symbol:
					missing += 1
				if missing <= 1:
					return True
			if (missing == 0 or missing == 3) and matrix[i][j] == symbol:
				return True
	return False
print('YES' if checker('#') or checker('.') else 'NO')


grid = [input() for _ in range(4)]
for x in range(3):
	for y in range(3):
		count = 0
		if grid[x][y] == '#':
			count += 1
		if grid[x][y + 1] == '#':
			count += 1
		if grid[x + 1][y] == '#':
			count += 1
		if grid[x + 1][y + 1] == '#':
			count += 1
		if count != 2:
			print('YES')
			exit()
print('NO')


import sys
grid = []
for i in range(4):
	grid.append(list(input()))
for i in range(3):
	for j in range(3):
		box = [(i, j), (i, j + 1), (i + 1, j), (i + 1, j + 1)]
		w = 0
		b = 0
		for (x, y) in box:
			if grid[x][y] == '.':
				w += 1
			else:
				b += 1
		if w == 1 or b == 1 or w == 4 or (b == 4):
			print('YES')
			sys.exit(0)
print('NO')


a = []
for i in range(4):
	a.append(input())

def get_22(i, j):
	b = []
	for k in range(2):
		b.append(a[i + k][j:j + 2])
	return b

def count_res(a):
	count = 0
	for i in a:
		for j in i:
			if j == '#':
				count += 1
	return count

def count_res2(a):
	count = 0
	for i in a:
		for j in i:
			if j == '.':
				count += 1
	return count
status = False
for i in range(3):
	for j in range(3):
		z = get_22(i, j)
		if count_res(z) > 2:
			status = True
			break
	if status == True:
		break
for i in range(3):
	for j in range(3):
		z = get_22(i, j)
		if status == True:
			break
		if count_res2(z) > 2:
			status = True
			break
	if status == True:
		break
if status == True:
	print('YES')
else:
	print('NO')


l = []
for _ in range(4):
	m = input()
	l.append(m)
c = 0
for i in range(3):
	for j in range(3):
		m = [l[i][j], l[i][j + 1], l[i + 1][j], l[i + 1][j + 1]]
		a = m.count('#')
		if a != 2:
			print('YES')
			c = -1
			break
	if c == -1:
		break
if c == 0:
	print('NO')


def main(l):
	for i in range(3):
		for j in range(3):
			x = l[i][j] + l[i][j + 1] + l[i + 1][j] + l[i + 1][j + 1]
			if 5 > str.count(x, '.') > 2:
				return True
			if 5 > str.count(x, '#') > 2:
				return True
	return False
l = []
for m in range(4):
	l += [input()]
if main(l) == True:
	print('YES')
else:
	print('NO')


a = []
for i in range(4):
	b = list(input())
	a.append(b)
for i in range(3):
	for j in range(3):
		d = []
		d.append(a[i][j])
		d.append(a[i + 1][j])
		d.append(a[i][j + 1])
		d.append(a[i + 1][j + 1])
		g = d.count('#')
		if g != 2:
			print('YES')
			exit()
else:
	print('NO')


def Pertence(Esperado, p1, p2, p3, p4):
	x = []
	x.append(p1)
	x.append(p2)
	x.append(p3)
	x.append(p4)
	return x in Esperado

def Resultado():
	esperado = []
	x = -1
	for i in range(4):
		branco = []
		preto = []
		for j in range(4):
			if j == x:
				branco.append('#')
				preto.append('.')
			else:
				branco.append('.')
				preto.append('#')
		x += 1
		esperado.append(branco)
		esperado.append(preto)
	return esperado
entrada = []
for i in range(4):
	entrada.append(input())
Esperado = Resultado()
flag = 0
for i in range(3):
	for j in range(3):
		if Pertence(Esperado, entrada[i][j], entrada[i][j + 1], entrada[i + 1][j], entrada[i + 1][j + 1]):
			flag = 1
			break
	if flag:
		break
if flag:
	print('YES')
else:
	print('NO')


l = []
for i in range(4):
	b = input()
	l.append(b)
for i in range(4):
	for j in range(3):
		if i == 0:
			if l[i][j] == '#' and l[i][j + 1] == '#' or (l[i][j] == '.' and l[i][j + 1] == '.'):
				if l[i][j] == l[i + 1][j] and l[i][j + 1] == l[i + 1][j + 1]:
					print('YES')
					exit()
				if l[i + 1][j] == '#' and l[i + 1][j + 1] == '#' or (l[i + 1][j] == '.' and l[i + 1][j + 1] == '.'):
					break
				else:
					print('YES')
					exit()
		elif i == 3:
			if l[i][j] == l[i][j + 1]:
				if l[i][j] == l[i - 1][j] and l[i][j + 1] == l[i - 1][j + 1]:
					print('YES')
					exit()
				if l[i - 1][j] == l[i - 1][j + 1]:
					break
				else:
					print('YES')
					exit()
		elif l[i][j] == l[i][j + 1]:
			if l[i][j] == l[i + 1][j] and l[i][j + 1] == l[i + 1][j + 1]:
				print('YES')
				exit()
			if l[i - 1][j] != l[i - 1][j + 1]:
				print('YES')
				exit()
			if l[i + 1][j] != l[i + 1][j + 1]:
				print('YES')
				exit()
print('NO')


a = []
for i in range(4):
	x = input()
	a.append(x)
for i in range(3):
	for j in range(3):
		x = ''
		x += a[i][j] + a[i][j + 1] + a[i + 1][j] + a[i + 1][j + 1]
		d = x.count('.')
		h = x.count('#')
		if d == 3 or h == 3 or d == 4 or (h == 4):
			print('YES')
			exit()
print('NO')


def get_ints(string):
	return list(map(int, string.split()))

def get_input():
	a = get_ints(input())
	return a

def sq_sum(sq):
	sq = list(sq)
	return sq[0].count('#') + sq[1].count('#')

def main():
	sq = []
	for _ in range(4):
		sq.append(input())
	for i in range(3):
		for j in range(3):
			new_sq = (sq[i][j:j + 2], sq[i + 1][j:j + 2])
			if sq_sum(new_sq) != 2:
				print('YES')
				return
	print('NO')
main()


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
a = []
n = 4
for i in range(4):
	a.append([int(i == '#') for i in input()])

def check(a):
	for i in range(3):
		for j in range(3):
			x = a[i][j] + a[i + 1][j] + a[i][j + 1] + a[i + 1][j + 1]
			if x == 4 or x == 0:
				return True
	return False
ans = 'NO'
for x in range(4):
	for y in range(4):
		b = [[0] * 4 for i in range(4)]
		for i in range(4):
			for j in range(4):
				b[i][j] = a[i][j]
		b[x][y] = 1
		if check(b):
			ans = 'YES'
			break
for x in range(4):
	for y in range(4):
		b = [[0] * 4 for i in range(4)]
		for i in range(4):
			for j in range(4):
				b[i][j] = a[i][j]
		b[x][y] = 0
		if check(b):
			ans = 'YES'
			break
print(ans)


matriz = [input() for _ in range(4)]
for i in range(3):
	for j in range(3):
		count = 0
		if matriz[i][j] == '#':
			count += 1
		if matriz[i][j + 1] == '#':
			count += 1
		if matriz[i + 1][j] == '#':
			count += 1
		if matriz[i + 1][j + 1] == '#':
			count += 1
		if count != 2:
			print('YES')
			exit()
print('NO')


def valid_grid(l):
	(pt, pd) = (0, 0)
	for i in l:
		if i == '#':
			pd += 1
		else:
			pt += 1
	if pd == 3 or pt == 3:
		return True
	return False
grid = []
found = False
for i in range(4):
	grid.append([c for c in input()])
for i in range(3):
	for j in range(3):
		sgrid = [grid[i][j], grid[i][j + 1], grid[i + 1][j], grid[i + 1][j + 1]]
		if len(set(sgrid)) == 1 or valid_grid(sgrid):
			found = True
			break
	if found:
		break
if found:
	print('YES')
else:
	print('NO')


s = ''.join((input() for _ in range(4)))
ans = False
for i in range(11):
	if (i + 1) % 4:
		S = s[i] + s[i + 1] + s[i + 4] + s[i + 5]
		if S.count('.') >= 3 or S.count('#') >= 3:
			print('YES')
			ans = True
			break
if not ans:
	print('NO')


def read():
	inputs = input().strip()
	return list(map(int, inputs.split()))

def read_pair():
	return map(int, input().split(' '))
matrix = []
for i in range(4):
	l = input()
	a = []
	for j in range(4):
		if l[j] == '#':
			a.append(1)
		else:
			a.append(0)
	a.append(228)
	matrix.append(a)
matrix.append(list([228, 228, 228, 228, 228]))
for i in range(4):
	for j in range(4):
		if matrix[i][j] + matrix[i + 1][j] + matrix[i][j + 1] + matrix[i + 1][j + 1] == 3 or matrix[i][j] + matrix[i + 1][j] + matrix[i][j + 1] + matrix[i + 1][j + 1] == 1 or matrix[i][j] + matrix[i + 1][j] + matrix[i][j + 1] + matrix[i + 1][j + 1] == 0 or (matrix[i][j] + matrix[i + 1][j] + matrix[i][j + 1] + matrix[i + 1][j + 1] == 4):
			print('YES')
			quit()
print('NO')


l = []
s = []
e = 0
for i in range(4):
	l.append(input())
	if l[i] == '....':
		e += 1
for i in l:
	for j in i:
		if j == '#':
			s.append(0)
		else:
			s.append(-1)
i = 0
if e != 4:
	while i < 11:
		if i != 3 and i != 7 and (i != 11) and (i != 15):
			h = s[i] + s[i + 4] + s[i + 1] + s[i + 5]
			if h == -1 or h == 0 or h == -3 or (h == -4):
				print('YES')
				break
			else:
				i += 1
		else:
			i += 1
	else:
		print('NO')
else:
	print('YES')


a = []
for i in range(4):
	m = input()
	a.append(m)
hash = 0
for i in range(3):
	for j in range(3):
		hash = 0
		for (x, y) in [(i, j), (i + 1, j), (i, j + 1), (i + 1, j + 1)]:
			hash += a[x][y] == '#'
		if hash in [3, 4, 1, 0]:
			print('YES')
			exit()
print('NO')


from collections import Counter
s = [list(input()) for i in range(4)]
f = 0
for i in range(3):
	for j in range(3):
		temp = Counter([s[i][j], s[i][j + 1], s[i + 1][j], s[i + 1][j + 1]])
		if max(temp.values()) in [3, 4]:
			print('YES')
			f = 1
			break
	if f == 1:
		break
if f == 0:
	print('NO')


square = []
for i in range(4):
	square.append(list(input()))
testPassed = False
for i in range(3):
	for j in range(3):
		if testPassed:
			break
		smallSquare = square[i][j] + square[i + 1][j] + square[i][j + 1] + square[i + 1][j + 1]
		whiteCount = smallSquare.count('.')
		blackCount = smallSquare.count('#')
		if whiteCount == 3 and blackCount == 1 or (whiteCount == 1 and blackCount == 3) or (whiteCount == 4 and blackCount == 0) or (whiteCount == 0 and blackCount == 4):
			testPassed = True
			print('YES')
if not testPassed:
	print('NO')


import sys

def check_same_color(i, j):
	sum = paper[i][j] + paper[i + 1][j] + paper[i + 1][j + 1] + paper[i][j + 1]
	if sum != 2:
		return True
	return False

def set_no(l):
	arr = []
	for i in l:
		if i == '.':
			arr.append(0)
		else:
			arr.append(1)
	return arr
paper = []
for i in range(0, 4):
	row = list(input())
	paper.append(set_no(row))
for i in range(0, 4):
	for j in range(0, 4):
		if i + 1 < 4 and j + 1 < 4:
			if check_same_color(i, j):
				print('YES')
				sys.exit(0)
print('NO')


s = []
for i in range(4):
	s.append(list(input()))
f = 0
for i in range(4 - 2 + 1):
	for j in range(4 - 2 + 1):
		ans = [s[i][j], s[i + 1][j], s[i][j + 1], s[i + 1][j + 1]]
		if len(set(ans)) == 1 or ans.count('.') == 3 or ans.count('#') == 3:
			print('YES')
			exit()
print('NO')


def main():
	d = []
	for i in range(4):
		d.append(list(input()))
	for j in range(3):
		for p in range(3):
			hash = d[j][p:p + 2].count('#') + d[j + 1][p:p + 2].count('#')
			point = d[j][p:p + 2].count('.') + d[j + 1][p:p + 2].count('.')
			if max(hash, point) >= 3:
				print('YES')
				return
	print('NO')
main()


from sys import exit
a = []
b = []
for i in range(4):
	a.append(input())
for i in range(3):
	for j in range(3):
		b = []
		b.append(a[i][j])
		b.append(a[i][j + 1])
		b.append(a[i + 1][j])
		b.append(a[i + 1][j + 1])
		c = b.count('#')
		if c == 1 or c == 4:
			print('YES')
			exit()
		c2 = b.count('.')
		if c2 == 1 or c2 == 4:
			print('YES')
			exit()
print('NO')


from collections import Counter

def calculate(lines):
	row = 0
	col = 0
	row_char = 0
	col_char = 0
	black = '#'
	whitee = '.'
	while row <= 2 and col <= 2 and (row_char <= 2) and (col_char <= 2):
		c1 = lines[row_char][col_char]
		c2 = lines[row_char][col_char + 1]
		c3 = lines[row_char + 1][col_char]
		c4 = lines[row_char + 1][col_char + 1]
		counter = Counter([c1, c2, c3, c4])
		bcount = counter.get(black, 0)
		if bcount in [0, 1, 3, 4]:
			return 'YES'
		if col_char == 2:
			col_char = 0
			row_char += 1
		else:
			col_char += 1
	return 'NO'
lines = []
for i in range(4):
	lines.append(list(input()))
response = calculate(lines)
print(response)


matrix = [[0] * 6]
for i in range(4):
	s = input()
	line = [0] * 6
	k = 0
	for ch in s:
		if ch == '#':
			line[k + 1] = 1
		else:
			line[k + 1] = 0
		k += 1
	matrix.append(line)
matrix.append([0] * 6)
for h in range(1, 4):
	for w in range(1, 4):
		sum_l = 0
		for i in range(h, h + 2):
			for j in range(w, w + 2):
				sum_l += matrix[i][j]
		if sum_l >= 3:
			print('YES')
			exit(0)
		elif sum_l <= 1:
			print('YES')
			exit(0)
print('NO')


def get_ans(mat):
	for i in range(3):
		for j in range(3):
			if mat[i][j] == mat[i][j + 1] and mat[i][j + 1] == mat[i + 1][j + 1]:
				return 'YES'
			elif mat[i][j + 1] == mat[i + 1][j + 1] and mat[i + 1][j + 1] == mat[i + 1][j]:
				return 'YES'
			elif mat[i][j] == mat[i + 1][j] and mat[i + 1][j] == mat[i + 1][j + 1]:
				return 'YES'
			elif mat[i][j] == mat[i + 1][j] and mat[i][j] == mat[i][j + 1]:
				return 'YES'
	return 'NO'
mat = []
mat.append(str(input()))
mat.append(str(input()))
mat.append(str(input()))
mat.append(str(input()))
print(get_ans(mat))


l = []
b = 1
for i in range(4):
	l.append(input())
for i in range(3):
	for j in range(3):
		count = 0
		if l[i][j] == l[i][j + 1]:
			count += 1
		if l[i + 1][j] == l[i][j]:
			count += +1
		if l[i + 1][j + 1] == l[i][j]:
			count += 1
		if l[i][j + 1] == l[i + 1][j + 1] and l[i + 1][j + 1] == l[i + 1][j] and (l[i + 1][j] == l[i][j + 1]):
			print('YES')
			b = 0
			break
		if count >= 2:
			print('YES')
			b = 0
			break
	if b == 0:
		break
if b == 1:
	print('NO')


s1 = input()
s2 = input()
s3 = input()
s4 = input()
st = [s1, s2, s3, s4]
arr = []
for i in st:
	tmp = []
	for j in i:
		tmp.append(j)
	arr.append(tmp)
boo = True
for i in range(3):
	for j in range(3):
		if arr[i][j] == '#':
			c = 0
			if arr[i][j + 1] == '#':
				c += 1
			if arr[i + 1][j] == '#':
				c += 1
			if arr[i + 1][j + 1] == '#':
				c += 1
			if c > 1:
				print('YES')
				boo = False
				exit(0)
			if arr[i][j + 1] == '.' and arr[i + 1][j] == '.' and (arr[i + 1][j + 1] == '.'):
				print('YES')
				boo = False
				exit(0)
		elif arr[i][j] == '.':
			f = 0
			if arr[i][j + 1] == '.':
				f += 1
			if arr[i + 1][j] == '.':
				f += 1
			if arr[i + 1][j + 1] == '.':
				f += 1
			if f > 1:
				print('YES')
				boo = False
				exit(0)
			if arr[i][j + 1] == '#' and arr[i + 1][j] == '#' and (arr[i + 1][j + 1] == '#'):
				print('YES')
				boo = False
				exit(0)
if boo:
	print('NO')


lis = [0, 0, 0, 0]
for i in range(4):
	lis[i] = input().strip()

def ch(a, b, c, d):
	return int(bool(a == b == c or b == c == d or c == d == a or (a == b == d)))
check = 0
for i in range(3):
	for j in range(3):
		if ch(lis[i][j], lis[i][j + 1], lis[i + 1][j], lis[i + 1][j + 1]) == 1:
			check = 1
if check == 0:
	print('NO')
else:
	print('YES')


import collections
A = []
for i in range(4):
	s = input()
	A.append(list(s))
for i in range(3):
	for j in range(3):
		B = [A[i][j], A[i + 1][j], A[i][j + 1], A[i + 1][j + 1]]
		D = collections.Counter(B)
		if D['#'] >= 3 or D['.'] >= 3:
			print('YES')
			exit()
print('NO')


BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from collections import Counter
grid = []
for i in range(4):
	grid.append(list(input()))
ans = False
for i in range(len(grid) - 1):
	for j in range(len(grid) - 1):
		got = [grid[i][j], grid[i][j + 1], grid[i + 1][j], grid[i + 1][j + 1]]
		if got.count('.') >= 3 or got.count('#') >= 3:
			ans = True
			break
if ans:
	print('YES')
else:
	print('NO')


l = []
for _ in range(4):
	l.append(input())
res = False
for _ in range(3):
	for i in range(3):
		for j in range(3):
			x = l[i][j:j + 2]
			y = l[i + 1][j:j + 2]
			(a, b) = (x.count('#'), x.count('.'))
			(c, d) = (y.count('#'), y.count('.'))
			if a + c >= 3 or b + d >= 3:
				res = True
				break
if res:
	print('YES')
else:
	print('NO')


s = []
for i in range(4):
	s.append(input())
b = False
for i in range(3):
	for j in range(3):
		if s[i][j] == s[i][j + 1]:
			if s[i][j] in s[i + 1][j:j + 2]:
				b = True
		if s[i + 1][j] == s[i + 1][j + 1]:
			if s[i + 1][j] in s[i][j:j + 2]:
				b = True
if b:
	print('YES')
else:
	print('NO')


m = [[x for x in input().split(' ')] for j in range(4)]

def find(s):
	c1 = 0
	c2 = 0
	for i in s:
		if i == '#':
			c1 += 1
		else:
			c2 += 1
	if c1 != c2:
		return True
	else:
		return False
test = False
for i in range(len(m) - 1):
	sq1 = m[i][0][:2]
	sq21 = m[i + 1][0][:2]
	sq2 = m[i][0][1:3]
	sq22 = m[i + 1][0][1:3]
	sq3 = m[i][0][2:4]
	sq23 = m[i + 1][0][2:4]
	res1 = find(sq1 + sq21)
	res2 = find(sq2 + sq22)
	res3 = find(sq3 + sq23)
	if res1 == True or res2 == True or res3 == True:
		test = True
		break
if test:
	print('YES')
else:
	print('NO')


def comp(a, b, c, d):
	if a == b and b == c and (a != d):
		return True
	if a == b and b == d and (a != c):
		return True
	if a == c and d == c and (a != b):
		return True
	if b == c and c == d and (b != a):
		return True
	return False

def ig(a, b, c, d):
	if a == b and b == c and (c == d):
		return True
	return False
mat = []
ans = 'NO'
for i in range(4):
	mat.append(input())
for i in range(3):
	for j in range(3):
		if comp(mat[i][j], mat[i + 1][j], mat[i][j + 1], mat[i + 1][j + 1]) or ig(mat[i][j], mat[i + 1][j], mat[i][j + 1], mat[i + 1][j + 1]):
			ans = 'YES'
print(ans)


paper = [input() for i in range(4)]
flage = 1
i = 0
while i < 3 and flage:
	j = 0
	while j < 3 and flage:
		if paper[i][j] == paper[i][j + 1] and paper[i][j] == paper[i + 1][j]:
			flage = 0
		elif paper[i][j] == paper[i][j + 1] and paper[i][j] == paper[i + 1][j + 1]:
			flage = 0
		elif paper[i][j] == paper[i + 1][j] and paper[i][j] == paper[i + 1][j + 1]:
			flage = 0
		elif paper[i + 1][j] == paper[i][j + 1] and paper[i + 1][j] == paper[i + 1][j + 1]:
			flage = 0
		j += 1
	i += 1
if flage - 1:
	print('YES')
else:
	print('NO')


a = input()
b = input()
c = input()
d = input()
if a[0] == '#' and a[1] == '#' and (b[0] == '#') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if a[0] == '#' and a[1] == '#' and (b[1] == '#') and (b[0] == '#' or b[0] == '.'):
	print('YES')
	exit()
if a[0] == '#' and b[1] == '#' and (b[0] == '#') and (a[1] == '#' or a[1] == '.'):
	print('YES')
	exit()
if a[1] == '#' and b[1] == '#' and (b[0] == '#') and (a[0] == '#' or a[0] == '.'):
	print('YES')
	exit()
if a[1] == '#' and a[2] == '#' and (b[1] == '#') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if a[1] == '#' and a[2] == '#' and (b[2] == '#') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if a[1] == '#' and b[2] == '#' and (b[1] == '#') and (a[2] == '#' or a[2] == '.'):
	print('YES')
	exit()
if a[2] == '#' and b[2] == '#' and (b[1] == '#') and (a[1] == '#' or a[1] == '.'):
	print('YES')
	exit()
if a[2] == '#' and a[3] == '#' and (b[2] == '#') and (b[3] == '#' or b[3] == '.'):
	print('YES')
	exit()
if a[2] == '#' and a[3] == '#' and (b[3] == '#') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if a[2] == '#' and b[2] == '#' and (b[3] == '#') and (a[3] == '#' or a[3] == '.'):
	print('YES')
	exit()
if a[3] == '#' and b[3] == '#' and (b[2] == '#') and (a[2] == '#' or a[2] == '.'):
	print('YES')
	exit()
if b[0] == '#' and b[1] == '#' and (c[0] == '#') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if b[0] == '#' and b[1] == '#' and (c[1] == '#') and (c[0] == '#' or c[0] == '.'):
	print('YES')
	exit()
if b[0] == '#' and c[1] == '#' and (c[0] == '#') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if b[1] == '#' and c[1] == '#' and (c[0] == '#') and (b[0] == '#' or b[0] == '.'):
	print('YES')
	exit()
if b[1] == '#' and b[2] == '#' and (c[1] == '#') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if b[1] == '#' and b[2] == '#' and (c[2] == '#') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if b[1] == '#' and c[2] == '#' and (c[1] == '#') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if b[2] == '#' and c[2] == '#' and (c[1] == '#') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if b[2] == '#' and b[3] == '#' and (c[2] == '#') and (c[3] == '#' or c[3] == '.'):
	print('YES')
	exit()
if b[2] == '#' and c[3] == '#' and (b[3] == '#') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if b[2] == '#' and c[2] == '#' and (c[3] == '#') and (b[3] == '#' or b[3] == '.'):
	print('YES')
	exit()
if b[3] == '#' and c[3] == '#' and (c[2] == '#') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if c[0] == '#' and c[1] == '#' and (d[0] == '#') and (d[1] == '#' or d[1] == '.'):
	print('YES')
	exit()
if c[0] == '#' and c[1] == '#' and (d[1] == '#') and (d[0] == '#' or d[0] == '.'):
	print('YES')
	exit()
if c[0] == '#' and d[1] == '#' and (d[0] == '#') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if c[1] == '#' and d[1] == '#' and (d[0] == '#') and (c[0] == '#' or c[0] == '.'):
	print('YES')
	exit()
if c[1] == '#' and c[2] == '#' and (d[1] == '#') and (d[2] == '#' or d[2] == '.'):
	print('YES')
	exit()
if d[1] == '#' and c[2] == '#' and (d[2] == '#') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if c[1] == '#' and d[2] == '#' and (d[1] == '#') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if d[2] == '#' and c[2] == '#' and (c[1] == '#') and (d[1] == '#' or d[1] == '.'):
	print('YES')
	exit()
if c[2] == '#' and c[3] == '#' and (d[2] == '#') and (d[3] == '#' or d[3] == '.'):
	print('YES')
	exit()
if c[2] == '#' and c[3] == '#' and (d[3] == '#') and (d[2] == '#' or d[2] == '.'):
	print('YES')
	exit()
if d[2] == '#' and c[2] == '#' and (d[3] == '#') and (c[3] == '#' or c[3] == '.'):
	print('YES')
	exit()
if c[3] == '#' and d[3] == '#' and (d[2] == '#') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if a[0] == '.' and a[1] == '.' and (b[0] == '.') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if a[0] == '.' and a[1] == '.' and (b[1] == '.') and (b[0] == '#' or b[0] == '.'):
	print('YES')
	exit()
if a[0] == '.' and b[1] == '.' and (b[0] == '.') and (a[1] == '#' or a[1] == '.'):
	print('YES')
	exit()
if a[1] == '.' and b[1] == '.' and (b[0] == '.') and (a[0] == '#' or a[0] == '.'):
	print('YES')
	exit()
if a[1] == '.' and a[2] == '.' and (b[1] == '.') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if a[1] == '.' and a[2] == '.' and (b[2] == '.') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if a[1] == '.' and b[2] == '.' and (b[1] == '.') and (a[2] == '#' or a[2] == '.'):
	print('YES')
	exit()
if a[2] == '.' and b[2] == '.' and (b[1] == '.') and (a[1] == '#' or a[1] == '.'):
	print('YES')
	exit()
if a[2] == '.' and a[3] == '.' and (b[2] == '.') and (b[3] == '#' or b[3] == '.'):
	print('YES')
	exit()
if a[2] == '.' and a[3] == '.' and (b[3] == '.') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if a[2] == '.' and b[2] == '.' and (b[3] == '.') and (a[3] == '#' or a[3] == '.'):
	print('YES')
	exit()
if a[3] == '.' and b[3] == '.' and (b[2] == '.') and (a[2] == '#' or a[2] == '.'):
	print('YES')
	exit()
if b[0] == '.' and b[1] == '.' and (c[0] == '.') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if b[0] == '.' and b[1] == '.' and (c[1] == '.') and (c[0] == '#' or c[0] == '.'):
	print('YES')
	exit()
if b[0] == '.' and c[1] == '.' and (c[0] == '.') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if b[1] == '.' and c[1] == '.' and (c[0] == '.') and (b[0] == '#' or b[0] == '.'):
	print('YES')
	exit()
if b[1] == '.' and b[2] == '.' and (c[1] == '.') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if b[1] == '.' and b[2] == '.' and (c[2] == '.') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if b[1] == '.' and c[2] == '.' and (c[1] == '.') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if b[2] == '.' and c[2] == '.' and (c[1] == '.') and (b[1] == '#' or b[1] == '.'):
	print('YES')
	exit()
if b[2] == '.' and b[3] == '.' and (c[2] == '.') and (c[3] == '#' or c[3] == '.'):
	print('YES')
	exit()
if b[2] == '.' and c[3] == '.' and (b[3] == '.') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if b[2] == '.' and c[2] == '.' and (c[3] == '.') and (b[3] == '#' or b[3] == '.'):
	print('YES')
	exit()
if b[3] == '.' and c[3] == '.' and (c[2] == '.') and (b[2] == '#' or b[2] == '.'):
	print('YES')
	exit()
if c[0] == '.' and c[1] == '.' and (d[0] == '.') and (d[1] == '.' or d[1] == '.'):
	print('YES')
	exit()
if c[0] == '.' and c[1] == '.' and (d[1] == '.') and (d[0] == '#' or d[0] == '.'):
	print('YES')
	exit()
if c[0] == '.' and d[1] == '.' and (d[0] == '.') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if c[1] == '.' and d[1] == '.' and (d[0] == '.') and (c[0] == '#' or c[0] == '.'):
	print('YES')
	exit()
if c[1] == '.' and c[2] == '.' and (d[1] == '.') and (d[2] == '#' or d[2] == '.'):
	print('YES')
	exit()
if d[1] == '.' and c[2] == '.' and (d[2] == '.') and (c[1] == '#' or c[1] == '.'):
	print('YES')
	exit()
if c[1] == '.' and d[2] == '.' and (d[1] == '.') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
if d[2] == '.' and c[2] == '.' and (c[1] == '.') and (d[1] == '#' or d[1] == '.'):
	print('YES')
	exit()
if c[2] == '.' and c[3] == '.' and (d[2] == '.') and (d[3] == '#' or d[3] == '.'):
	print('YES')
	exit()
if c[2] == '.' and c[3] == '.' and (d[3] == '.') and (d[2] == '#' or d[2] == '.'):
	print('YES')
	exit()
if d[2] == '.' and c[2] == '.' and (d[3] == '.') and (c[3] == '#' or c[3] == '.'):
	print('YES')
	exit()
if c[3] == '.' and d[3] == '.' and (d[2] == '.') and (c[2] == '#' or c[2] == '.'):
	print('YES')
	exit()
else:
	print('NO')


def solve(grid):
	for i in range(3):
		for j in range(3):
			b = 0
			w = 0
			if grid[i][j] == '#':
				b += 1
			else:
				w += 1
			if grid[i + 1][j] == '#':
				b += 1
			else:
				w += 1
			if grid[i][j + 1] == '#':
				b += 1
			else:
				w += 1
			if grid[i + 1][j + 1] == '#':
				b += 1
			else:
				w += 1
			if w >= 3 or b >= 3:
				return 'YES'
	return 'NO'
grid = []
for i in range(4):
	s = list(input())
	grid.append(s)
print(solve(grid))


import sys
my_file = sys.stdin
a = my_file.read().strip().split('\n')

def result():
	for i in range(3):
		for k in range(3):
			if (a[i][k] == a[i][k + 1] == a[i + 1][k] == '#' or a[i][k] == a[i][k + 1] == a[i + 1][k + 1] == '#') or (a[i][k] == a[i][k + 1] == a[i + 1][k] == '.' or a[i][k] == a[i][k + 1] == a[i + 1][k + 1] == '.') or (a[i + 1][k] == a[i + 1][k + 1] == a[i][k] == '#' or a[i + 1][k] == a[i + 1][k + 1] == a[i][k + 1] == '#') or (a[i + 1][k] == a[i + 1][k + 1] == a[i][k] == '.' or a[i + 1][k] == a[i + 1][k + 1] == a[i][k + 1] == '.'):
				print('YES')
				return
	else:
		print('NO')
		return
result()


matrix = []
flag = False
for i in range(4):
	matrix.append(list(input()))
for i in range(1, 4):
	for j in range(0, 3):
		t = 0
		if matrix[i][j] == '.':
			t += 1
		if matrix[i][j + 1] == '.':
			t += 1
		if matrix[i - 1][j] == '.':
			t += 1
		if matrix[i - 1][j + 1] == '.':
			t += 1
		if t != 2:
			flag = True
			break
if flag:
	print('YES')
else:
	print('NO')


arr = []
for i in range(4):
	arr.append(input())
for i in range(3):
	for j in range(3):
		x = arr[i][j] + arr[i][j + 1] + arr[i + 1][j] + arr[i + 1][j + 1]
		if 2 < x.count('.') < 5:
			print('YES')
			exit()
		if 2 < x.count('#') < 5:
			print('YES')
			exit()
print('NO')


result = False
x = []
for i in range(4):
	x.append(input().split()[0])
for y in range(3):
	for z in range(3):
		sumH = 0
		sumW = 0
		curBox = str(x[y][z])
		curBox += x[y + 1][z]
		curBox += x[y][z + 1]
		curBox += x[y + 1][z + 1]
		for q in curBox:
			if q == '#':
				sumH += 1
			else:
				sumW += 1
		if sumH >= 3 or sumW >= 3:
			result = True
if result:
	print('YES')
else:
	print('NO')


sheet = [input() for _ in range(4)]
cnt = 0
cnt1 = 0
for i in range(3):
	for j in range(3):
		cnt = 0
		cnt1 = 0
		if sheet[i][j] == '#':
			cnt += 1
		if sheet[i + 1][j] == '#':
			cnt += 1
		if sheet[i][j + 1] == '#':
			cnt += 1
		if sheet[i + 1][j + 1] == '#':
			cnt += 1
		if sheet[i][j] == '.':
			cnt1 += 1
		if sheet[i + 1][j] == '.':
			cnt1 += 1
		if sheet[i][j + 1] == '.':
			cnt1 += 1
		if sheet[i + 1][j + 1] == '.':
			cnt1 += 1
		if cnt > 2 or cnt1 > 2:
			print('YES')
			quit()
print('NO')


def adjacent_present(list1):
	for index in range(len(list1) - 1):
		if list1[index] == list1[index + 1] == '#':
			return (True, index)
	return (False, 'np')

def adjacent_present_2(list1):
	for index in range(len(list1) - 1):
		if list1[index] == list1[index + 1] == '.':
			return (True, index)
	return (False, 'np')
row1 = input()
row2 = input()
row3 = input()
row4 = input()
list1 = []
for char in row1:
	list1.append(char)
list2 = []
for char in row2:
	list2.append(char)
list3 = []
for char in row3:
	list3.append(char)
list4 = []
for char in row4:
	list4.append(char)
flag = False
if adjacent_present(list1)[0] == True:
	pos = adjacent_present(list1)[1]
	if list2[pos] == '#' or list2[pos + 1] == '#':
		flag = True
if not flag:
	if adjacent_present(list2)[0] == True:
		pos = adjacent_present(list2)[1]
		if list1[pos] == '#' or list1[pos + 1] == '#' or list3[pos] == '#' or (list3[pos + 1] == '#'):
			flag = True
if not flag:
	if adjacent_present(list3)[0] == True:
		pos = adjacent_present(list3)[1]
		if list2[pos] == '#' or list2[pos + 1] == '#' or list4[pos] == '#' or (list4[pos + 1] == '#'):
			flag = True
if not flag:
	if adjacent_present(list4)[0] == True:
		pos = adjacent_present(list4)[1]
		if list3[pos] == '#' or list3[pos + 1] == '#':
			flag = True
if not flag:
	if adjacent_present_2(list1)[0] == True:
		pos = adjacent_present_2(list1)[1]
		if list2[pos] == '.' or list2[pos + 1] == '.':
			flag = True
	if adjacent_present_2(list2)[0] == True:
		pos = adjacent_present_2(list2)[1]
		if list1[pos] == '.' or list1[pos + 1] == '.' or list3[pos] == '.' or (list3[pos + 1] == '.'):
			flag = True
	if adjacent_present_2(list3)[0] == True:
		pos = adjacent_present_2(list3)[1]
		if list2[pos] == '.' or list2[pos + 1] == '.' or list4[pos] == '.' or (list4[pos + 1] == '.'):
			flag = True
	if adjacent_present_2(list4)[0] == True:
		pos = adjacent_present_2(list4)[1]
		if list3[pos] == '.' or list3[pos + 1] == '.':
			flag = True
if flag:
	print('YES')
else:
	print('NO')


m = [input().strip() for i in range(4)]
for i in range(0, 3):
	for j in range(0, 3):
		k = 0
		for x in range(i, i + 2):
			for y in range(j, j + 2):
				if m[x][y] == '#':
					k += 1
		if k == 0 or k == 1 or k == 3 or (k == 4):
			print('YES')
			exit()
print('NO')


l = []
for i in range(4):
	l.append(input())
flag = False
for i in range(3):
	for j in range(3):
		(w, b) = (0, 0)
		for x in range(i, i + 2):
			for y in range(j, j + 2):
				if l[x][y] == '#':
					b += 1
				else:
					w += 1
		if abs(w - b) == 2 or w == 4 or b == 4:
			flag = True
			break
	if flag:
		break
if flag:
	print('YES')
else:
	print('NO')


l = [input() for i in range(4)]
dn = False
for i in range(3):
	for j in range(3):
		ck = [l[i][j], l[i][j + 1], l[i + 1][j], l[i + 1][j + 1]]
		if ck.count('#') >= 3 or ck.count('.') >= 3:
			print('YES')
			dn = True
			break
	if dn:
		break
else:
	print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	aa = [S() for _ in range(4)]
	for i in range(3):
		for j in range(3):
			c = collections.defaultdict(int)
			for k in range(i, i + 2):
				for l in range(j, j + 2):
					c[aa[k][l]] += 1
			if max(c.values()) > 2:
				return 'YES'
	return 'NO'
print(main())