import sys sys.setrecursionlimit(10**7) from functools import cache MOD=998244353 @cache def factorial(d): if d == 0 or d == 1: return 1 else: return (d * factorial(d - 1)) N=int(input()) n=N//2 S=input() if S[0]!=S[1]: type=1 else: type=0 if type==1: ans = 1 for i in range(n): ans=(ans*2)%MOD else: ans = 0 for r in range(0, n+1): x=factorial(n)//factorial(n-r)//factorial(r) ans = (ans + x*x)%MOD print(ans)