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

total_ships = 0
for row in field:
    total_ships += row.count('#')

if total_ships != 20:
    print("NO")
    exit()

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]

def is_valid_ship(x, y, dx, dy, length):
    for _ in range(length):
        if x < 0 or x >= 10 or y < 0 or y >= 10 or field[x][y] != '#':
            return False
        x, y = x + dx, y + dy
    return True

ship_lengths = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]

for length in ship_lengths:
    found = False
    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                for d in range(4):
                    x, y = i, j
                    if is_valid_ship(x, y, dx[d], dy[d], length):
                        found = True
                        break
                if found:
                    break
    if not found:
        print("NO")
        exit()

print("YES")
