import java.io.BufferedReader
import java.io.InputStreamReader
import kotlin.math.min

const val MOD = 998244353L

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val line = jin.readLine().split(" ")
    val s = line[0]
    val k = line[1].toInt()
    val ones = mutableListOf<Int>()
    var curr = 0
    for (chara in s.reversed()) {
        when (chara) {
            '0' -> {
                ones.add(curr)
                curr = 0
            }
            '1' -> curr += 1
        }
    }
    ones.add(curr)
    var dp = Array(301) { LongArray(601) }
    dp[0][0] = 1L
    var j = 0
    for (nu in ones) {
        j++
        val dpUp = Array(301) { LongArray(601) }
        val dpDown = Array(301) { LongArray(601) }
        for (b in 0..300) {
            for (c in 0..600) {
                if (b > 0 && c > 0) {
                    dpUp[b][c] = dpUp[b - 1][c - 1]
                    dpUp[b][c] += dp[b - 1][c - 1]
                }
                if (b - nu - 1 >= 0 && c - nu - 1 >= 0) {
                    dpUp[b][c] -= dp[b - nu - 1][c - nu - 1]
                }
                dpUp[b][c] %= MOD
            }
        }
        for (b in 300 downTo 0) {
            for (c in 600 downTo 0) {
                if (b + 1 <= 300 && c > 0) {
                    dpDown[b][c] = dpDown[b + 1][c - 1]
                }
                dpDown[b][c] += dp[b][c]
                dpDown[b][c] %= MOD
            }
        }
        for (b in 0..300) {
            dp[b].fill(0L)
            for (c in 0..600) {
                dp[b][c] = dpDown[b][c] + dpUp[b][c]
                dp[b][c] %= MOD
            }
        }
    }
    var answer = 0L
    for (c in 0..min(600, 2 * k)) {
        answer += dp[0][c]
        answer %= MOD
    }
    answer += MOD
    answer %= MOD
    println(answer)
}