def is_valid_battleship_board(board):
    def is_ship(cell):
        return cell == '#'

    def check_ship_size(board, x, y, dx, dy, size):
        for i in range(size):
            if not (0 <= x < 10) or not (0 <= y < 10) or not is_ship(board[x][y]):
                return False
            x += dx
            y += dy
        return True

    for i in range(10):
        for j in range(10):
            if is_ship(board[i][j]):
                if (i > 0 and is_ship(board[i - 1][j])) or (j > 0 and is_ship(board[i][j - 1])):
                    return "NO"
                if (i < 9 and is_ship(board[i + 1][j])) or (j < 9 and is_ship(board[i][j + 1])):
                    return "NO"
                if check_ship_size(board, i, j, 1, 0, 1) or check_ship_size(board, i, j, 0, 1, 1):
                    return "NO"
                if check_ship_size(board, i, j, 1, 0, 4) or check_ship_size(board, i, j, 0, 1, 4):
                    return "NO"
                if check_ship_size(board, i, j, 1, 0, 3) and not (check_ship_size(board, i, j, -1, 0, 1) or check_ship_size(board, i, j, 4, 0, 1)):
                    return "NO"
                if check_ship_size(board, i, j, 0, 1, 3) and not (check_ship_size(board, i, j, 0, -1, 1) or check_ship_size(board, i, j, 0, 4, 1)):
                    return "NO"

    return "YES"

# Считываем поле из входных данных
field = [list(input()) for _ in range(10)]

# Проверяем корректность расстановки кораблей и выводим результат
print(is_valid_battleship_board(field))
