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

    def is_valid_ship(ship):
        if ship.count('#') not in [1, 2, 3, 4]:
            return False
        if '#' in ship and '.' in ship:
            return False
        return True

    def check_ships(board):
        for row in board:
            for i in range(len(row)):
                if is_ship(row[i]):
                    ship = [row[i]]
                    if i < len(row) - 1:
                        j = i + 1
                        while j < len(row) and is_ship(row[j]):
                            ship.append(row[j])
                            j += 1
                    if not is_valid_ship(ship):
                        return False
        return True

    if not all(len(row) == 10 for row in board):
        return False

    if not check_ships(board):
        return False

    for i in range(len(board[0])):
        column = [row[i] for row in board]
        if not check_ships([column]):
            return False

    return True

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

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