def main(): n = int(input()) s = list(input()) mod = 998244353 dp = [[0,0] for _ in range(n+1)] dp[0][0] = 1 for i in range(n): if s[i] == "0": dp[i+1][0] = dp[i][0]+dp[i][1] else: dp[i+1][1] = dp[i][0]+dp[i][1] dp[i+1][1] += dp[i][1] dp[i+1][0] %= mod dp[i+1][1] %= mod print(dp[-1][1]) if __name__ == '__main__': main()