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: interview

Starter code:

Solutions:
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]+L[i][j+1]+L[i+1][j]+L[i+1][j+1]
        if(x.count('#')==3 or x.count('.')==3 or x.count('#')==4 or x.count('.')==4):
            ans="YES"
print(ans)
            
        


import sys
my_file = sys.stdin
#my_file = open("input.txt", "r")
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()

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)

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')



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')

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()))])


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")

__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


def __starting_point():
    exit(main())
__starting_point()

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

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")
            return
        
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')


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')
			return
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):
    a+=[input().replace('#','1').replace('.','0')]
d=False
for i in range(9):
    b,c=i//3,i%3
    if sum(map(int,[a[b][c],a[b+1][c],a[b][c+1],a[b+1][c+1]]))!=2:
        d=True
        break
print('YES'if d else'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
            else:
                if a==d:
                    g=1
                    print("YES")
                    break
        else:
            if b==c and c==d:
                g=1
                print("YES")
                break

    if g==1:
        break
if g==0:
    print("NO")

# coding: utf-8
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')


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")


__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)


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)

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")
            return
        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")
            return
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 _ 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')

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")

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')
		return
	
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')
			return
		if lst[i+1][temp]=='#' or lst[i+1][temp+1]=='#':
			print ('YES')
			return
		
if '##' in lst[3]:
	temp = lst[3].index('##')
	if lst[2][temp]=='#' or lst[2][temp+1]=='#':
		print ('YES')
		return
		
if '..' in lst[0]:
	temp = lst[0].index('..')
	if lst[1][temp]=='.' or lst[1][temp+1]=='.':
		print ('YES')
		return
	
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')
			return
		if lst[i+1][temp]=='.' or lst[i+1][temp+1]=='.':
			print ('YES')
			return
		
if '..' in lst[3]:
	temp = lst[3].index('..')
	if lst[2][temp]=='.' or lst[2][temp+1]=='.':
		print ('YES')
		return
		
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')