n = int(input()) S = list(map(int,input())) mod = 998244353 dp = [1,0] for s in S: ndp = [0,0] if s: ndp[1] = (dp[1]*2 + dp[0]) % mod else: ndp[0] = (dp[0] + dp[1]) % mod ndp[1] = dp[1] dp = ndp print(dp[1])