I,R=input,range N=int(I()) M=R(N) A=[[0]*N for i in R(N+1)] B=[0]*N S=I() P=998244353 for i in R(1,N+1): s=S[N-i]>"0" for j in R(i): B[j]+=(S[N-i]>"0")*(pow(2,max(0,i-j-1-1),P)-A[i-j-1][j]) A[i][j]=B[j]%P print(sum(pow(2,j,P)*A[N][j]for j in M)%P)