import sys input = sys.stdin.buffer.readline input() MOD = 998244353 x = 1 y = 0 for c in input(): if c == 49: y += x if y >= MOD: y -= MOD x = 0 x += y if x >= MOD: x -= MOD print(y)