def valid_battleship_board(board):
    ship_sizes = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    rows = len(board)
    cols = len(board[0])
    ship_counts = [0] * len(ship_sizes)

    for i in range(rows):
        for j in range(cols):
            if board[i][j] == '#':
                if i > 0 and board[i-1][j] == '#' or j > 0 and board[i][j-1] == '#':
                    return False
                if i < rows - 1 and board[i+1][j] == '#' or j < cols - 1 and board[i][j+1] == '#':
                    return False
                if i > 0 and board[i-1][j] != '#' and j > 0 and board[i][j-1] != '#':
                    return False
                
                size = 1
                while j+size < cols and board[i][j+size] == '#':
                    size += 1
                while i+size < rows and board[i+size][j] == '#':
                    size += 1
                
                if size not in ship_sizes:
                    return False
                
                ship_index = ship_sizes.index(size)
                ship_counts[ship_index] += 1
                if ship_counts[ship_index] > ship_index + 1:
                    return False

    for count, size in zip(ship_counts, ship_sizes):
        if count != size:
            return False

    return True

board = [input() for _ in range(10)]

if valid_battleship_board(board):
    print("YES")
else:
    print("NO")

