MOD = 998244353 N = int(input()) S = input() dp = [[0] * 2 for _ in range(N+1)] dp[0][0] = 1 for i, c in enumerate(S): if c == '0': dp[i+1][0] = dp[i][0] + dp[i][1] dp[i+1][0] %= MOD dp[i+1][1] = dp[i][1] else: dp[i+1][0] = 0 dp[i+1][1] = dp[i][0] + dp[i][1] * 2 dp[i+1][1] %= MOD ans = dp[N][1] print(ans)