local mod = 998244353
local mfl = math.floor
local function bmul(x, y)
  local x0, y0 = x % 31596, y % 31596
  local x1, y1 = mfl(x / 31596), mfl(y / 31596)
  return (x1 * y1 * 62863 + (x1 * y0 + x0 * y1) * 31596 + x0 * y0) % mod
end

local function badd(x, y)
  return (x + y) % mod
end

local function bsub(x, y)
  return x < y and x - y + mod or x - y
end

local s = io.read()
s, k = s:match("(%d+) (%d+)")
k = tonumber(k)
s = s:reverse()
local n = #s
local t = {}
local total_one = 0
for i = 1, n do
  if s:byte(i) == 49 then --1
    total_one = total_one + 1
  end
end

do
  local last_zero_pos = false
  for i = 1, n do
    if last_zero_pos then
      if s:byte(i) == 48 then
        table.insert(t, i - last_zero_pos - 1)
        last_zero_pos = i
      end
    else
      if s:byte(i) == 49 then
        last_zero_pos = i - 1
      end
    end
  end
  if last_zero_pos then
    table.insert(t, n - last_zero_pos)
  end
end

k = math.min(k, total_one)
local cur_one_cnt = 0
local dp1, dp2 = {}, {}
for i = 1, k + 1 do
  dp1[i] = {0}
  dp2[i] = {}
end
dp1[1][1] = 1
for i = 1, #t do
  local src = i % 2 == 1 and dp1 or dp2
  local dst = i % 2 == 1 and dp2 or dp1
  local ti = t[i]
  -- initialize
  for j = 1, k + 1 do
    local dj = dst[j]
    for q = 0, cur_one_cnt + ti do
      dj[q + 1] = 0
    end
  end
  -- copy
  for j = 1, k + 1 do
    local dj = dst[j]
    local sj = src[j]
    for q = 0, cur_one_cnt do
      dj[q + ti + 1] = sj[q + 1]
    end
  end
  -- cumulate
  for j = 1, k + 1 do
    local dj = dst[j]
    for q = 1, cur_one_cnt + ti do
      dj[q + 1] = badd(dj[q + 1], dj[q])
    end
  end
  -- copy add
  for j = 1, ti do
    for ik = 1, k + 1 do
      if k + 1 < ik + j then break end
      local dikj = dst[ik + j]
      local sik = src[ik]
      for q = 0, cur_one_cnt do
        dikj[q + ti - j + 1] = badd(dikj[q + ti - j + 1], sik[q + 1])
      end
    end
  end
  -- print("--- " .. i .. " ---")
  -- for ik = 1, k + 1 do
  --   print(table.concat(dst[ik], " "))
  -- end
  cur_one_cnt = cur_one_cnt + ti
end
local ret = 0
local tbl = #t % 2 == 1 and dp2 or dp1
for ik = 1, k + 1 do
  ret = badd(ret, tbl[ik][total_one + 1])
end
print(ret)
