def check_battleship_board(board):
    ships = {'four': 0, 'three': 0, 'two': 0, 'one': 0}

    for i in range(10):
        for j in range(10):
            if board[i][j] == '#':
                if i < 9 and board[i + 1][j] == '#':
                    if j < 9 and board[i][j + 1] == '#':
                        return "NO"
                    ships['four'] += 1
                    while i < 10 and board[i][j] == '#':
                        i += 1
                elif j < 9 and board[i][j + 1] == '#':
                    ships['four'] += 1
                    while j < 10 and board[i][j] == '#':
                        j += 1
                else:
                    ships['one'] += 1

    if ships['four'] != 1 or ships['three'] != 2 or ships['two'] != 3 or ships['one'] != 4:
        return "NO"
    return "YES"

# Получаем данные от пользователя для переменной board_input
board_input = []
print("Введите 10 строк, каждая из 10 символов (# или .) через пробел:")
for _ in range(10):
    row = input().strip()
    board_input.append(row)

result = check_battleship_board(board_input)
print(result)