fun main(args: Array<String>) {
    abc146f()
}

fun abc146f() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val s = readLine()!!.map { it == '1' }

    var currIdx = s.lastIndex
    val moves = mutableListOf<Int>()
    while (currIdx > 0) {
        var move = Math.min(m, currIdx)
        while (currIdx - move > 0 && s[currIdx - move]) move--
        if (move == 0) return println(-1)
        moves.add(move)
        currIdx -= move
    }

    val answer = moves.reversed().joinToString(" ")

    println(answer)
}
