#include using namespace std; const int N = 2e3 + 5; const int mod = 998244353; int n; string a; long long s[N][N], dp[N][N]; int main(){ cin >> n >> a; a = ' ' + a; dp[0][n] = 1; for(int j = 0; j <= n; j++) s[0][j] = 1; for(int i = 1; i <= n; i++){ for(int j = 0; j <= n; j++){ if(a[i] == '0'){ dp[i][j] = s[i - 1][j]; } else{ dp[i][j] = dp[i - 1][j + 1]; } } for(int j = n; j >= 0; j--){ s[i][j] = s[i][j + 1] + dp[i][j]; while(s[i][j] >= mod) s[i][j] -= mod; } } cout << (dp[n][0] + dp[n][1]) % mod; return 0; }