field = [list('.' + input() + '.') for _ in range(10)]


field.insert(0, list('.' * 12))
field.append(list('.' * 12))

sheps = list(range(1, 5))[::-1]


def leave():
    print("NO")
    exit()

def check(i, j):
    if field[i][j] != '#': return 0
    field[i][j] = '$'
    if check(i+1, j+1) or check(i-1, j+1) or check(i+1, j-1) or check(i-1, j-1): leave() 
    return 1 + check(i+1, j) + check(i-1, j) + check(i, j+1) + check(i, j-1)

def count(l):
    for i in l:
        if i < 0:
            leave()

def fcount(l):
    for i in l:
        if i:
            leave()
    print("YES")

for i in range(1, 11):
    for j in range(1, 11):
        count(sheps)
        if field[i][j] == '#':
            try: sheps[check(i, j) - 1] -= 1
            except IndexError: leave()
fcount(sheps)
