def is_valid_battleship_field(field):
    ship_lengths = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    
    def is_valid_ship_placement(ship_length, x, y, direction):
        if direction == "horizontal":
            return all(field[y][x + i] == "#" for i in range(ship_length))
        elif direction == "vertical":
            return all(field[y + i][x] == "#" for i in range(ship_length))
        return False

    for ship_length in ship_lengths:
        found = False
        for y in range(10):
            for x in range(10):
                if field[y][x] == "#":
                    if (x + ship_length <= 10 and is_valid_ship_placement(ship_length, x, y, "horizontal")) or \
                       (y + ship_length <= 10 and is_valid_ship_placement(ship_length, x, y, "vertical")):
                        found = True
                        break
            if found:
                break
        if not found:
            return "NO"
    
    return "YES"

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

result = is_valid_battleship_field(field)
print(result)
