import sys

input = sys.stdin.readline



S,K=input().split()

K=int(K)

mod=998244353



LEN=len(S)



ONES=[]

Z=0

for s in S:

    if s=="0":

        Z+=1

    else:

        ONES.append(Z)



if ONES==[]:

    print((1))

    sys.exit()



O=len(ONES)

Z=ONES[-1]



DP=[[0]*(O+1) for i in range(min(O,K)+1)]

DP[0][0]=1



# DP[i][j]で, i個石を動かし、j個石が残っているときの場合の数



from collections import Counter

C=Counter(ONES)



for numb in range(Z,-1,-1):

    #print(DP)

    c=C[numb]



    NDP=[[0]*(O+1) for i in range(min(O,K)+1)]



    for i in range(min(O,K)+1):        

        for j in range(O+1):

            if DP[i][j]==0:

                continue

            for oku in range(c+j+1):

                if i+max(0,oku-c)<=min(O,K) and 0<=c+j-oku<=O:

                    NDP[i+max(0,oku-c)][c+j-oku]+=DP[i][j]

    DP=NDP



ANS=0

for i in range(min(O,K)+1):

    ANS+=DP[i][0]



print((ANS%mod))

import sys

input = sys.stdin.readline



S,K=input().split()

K=int(K)

mod=998244353



LEN=len(S)



ONES=[]

Z=0

for s in S:

    if s=="0":

        Z+=1

    else:

        ONES.append(Z)



if ONES==[]:

    print((1))

    sys.exit()



O=len(ONES)

Z=ONES[-1]



DP=[[0]*(O+1) for i in range(min(O,K)+1)]

DP[0][0]=1



# DP[i][j]で, i個石を動かし、j個石が残っているときの場合の数



from collections import Counter

C=Counter(ONES)



for numb in range(Z,-1,-1):

    #print(DP)

    c=C[numb]



    NDP=[[0]*(O+1) for i in range(min(O,K)+1)]



    for i in range(min(O,K)+1):        

        for j in range(O+1):

            if DP[i][j]==0:

                continue

            for oku in range(c+j+1):

                if i+max(0,oku-c)<=min(O,K) and 0<=c+j-oku<=O:

                    NDP[i+max(0,oku-c)][c+j-oku]=(NDP[i+max(0,oku-c)][c+j-oku]+DP[i][j])%mod

    DP=NDP



ANS=0

for i in range(min(O,K)+1):

    ANS+=DP[i][0]



print((ANS%mod))

import sys

input = sys.stdin.readline
S, K = input().split()
K = int(K)
mod = 998244353
LEN = len(S)
ONES = []
Z = 0
for s in S:
    if s == "0":
        Z += 1
    else:
        ONES.append(Z)
if ONES == []:
    print((1))
    sys.exit()
O = len(ONES)
Z = ONES[-1]
DP = [[0] * (O + 1) for i in range(min(O, K) + 1)]
DP[0][0] = 1
# DP[i][j]で, i個石を動かし、j個石が残っているときの場合の数
from collections import Counter

C = Counter(ONES)
for numb in range(Z, -1, -1):
    # print(DP)
    c = C[numb]
    NDP = [[0] * (O + 1) for i in range(min(O, K) + 1)]
    for i in range(min(O, K) + 1):
        for j in range(O + 1):
            if DP[i][j] == 0:
                continue
            for oku in range(c + j + 1):
                if i + max(0, oku - c) <= min(O, K) and 0 <= c + j - oku <= O:
                    NDP[i + max(0, oku - c)][c + j - oku] += DP[i][j]
    DP = NDP
ANS = 0
for i in range(min(O, K) + 1):
    ANS += DP[i][0]
print((ANS % mod))

import sys

input = sys.stdin.readline
S, K = input().split()
K = int(K)
mod = 998244353
LEN = len(S)
ONES = []
Z = 0
for s in S:
    if s == "0":
        Z += 1
    else:
        ONES.append(Z)
if ONES == []:
    print((1))
    sys.exit()
O = len(ONES)
Z = ONES[-1]
DP = [[0] * (O + 1) for i in range(min(O, K) + 1)]
DP[0][0] = 1
# DP[i][j]で, i個石を動かし、j個石が残っているときの場合の数
from collections import Counter

C = Counter(ONES)
for numb in range(Z, -1, -1):
    # print(DP)
    c = C[numb]
    NDP = [[0] * (O + 1) for i in range(min(O, K) + 1)]
    for i in range(min(O, K) + 1):
        for j in range(O + 1):
            if DP[i][j] == 0:
                continue
            for oku in range(c + j + 1):
                if i + max(0, oku - c) <= min(O, K) and 0 <= c + j - oku <= O:
                    NDP[i + max(0, oku - c)][c + j - oku] = (
                        NDP[i + max(0, oku - c)][c + j - oku] + DP[i][j]
                    ) % mod
    DP = NDP
ANS = 0
for i in range(min(O, K) + 1):
    ANS += DP[i][0]
print((ANS % mod))

-                    NDP[i + max(0, oku - c)][c + j - oku] += DP[i][j] +                    NDP[i + max(0, oku - c)][c + j - oku] = ( +                        NDP[i + max(0, oku - c)][c + j - oku] + DP[i][j] +                    ) % mod