output_description: Print the number of the possible sequences Takahashi may have after repeating
  the procedure 2N times, modulo 998244353.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: mod = 998244353
  s = list(map(int, list(input())))
  n = len(s)
  dp = [[0] * (sum(s) + 1) for _ in range(2 * n + 1)]
  dp[0][0] = 1
  curr = curb = 0
  for i in range(2 * n):
      if i < n:
          curb += s[i]
          curr += 2 - s[i]
      for j in range(min(i, curb) + 1):
          if dp[i][j]:
              dp[i][j] %= mod
              if i - j < curr:
                  dp[i + 1][j] += dp[i][j]
              if j < curb:
                  dp[i + 1][j + 1] += dp[i][j]
  print(dp[2 * n][curb])
  
problem_description: Statement
  
  There are N Snukes lining up in a row. You are given a string S of length N.
  The i-th Snuke from the front has two red balls if the i-th character in S is
  `0`; one red ball and one blue ball if the i-th character in S is `1`; two
  blue balls if the i-th character in S is `2`.
  
  Takahashi has a sequence that is initially empty. Find the number of the
  possible sequences he may have after repeating the following procedure 2N
  times, modulo 998244353:
  
    * Each Snuke who has one or more balls simultaneously chooses one of his balls and hand it to the Snuke in front of him, or hand it to Takahashi if he is the first Snuke in the row.
    * Takahashi receives the ball and put it to the end of his sequence.
samples: [{"input": "02", "output": "3\n    \n\nThere are three sequences that Takahashi may have: `rrbb`, `rbrb` and `rbbr`,\nwhere `r` and `b` stand for red and blue balls, respectively.\n\n* * *"}, {"input": "1210", "output": "55\n    \n\n* * *"}, {"input": "12001021211100201020", "output": "543589959"}]