import sys input = sys.stdin.readline MOD = 998244353 N = int(input()) S = input().strip() dp = [[0 for _ in range(2)] for _ in range(N+1)] dp[0][0] = 1 for i in range(N): if S[i]=="1": dp[i+1][0] += dp[i][0] + dp[i][1] dp[i+1][0] %= MOD dp[i+1][1] += dp[i][0] + dp[i][1] dp[i+1][1] %= MOD else: dp[i+1][0] += dp[i][0] + dp[i][1] dp[i+1][0] %= MOD dp[i+1][1] += dp[i][1] dp[i+1][1] %= MOD print(dp[N][1])