#arc162f. [arc162_f]Montage

[arc162_f]Montage

Problem Statement

You are given positive integers NN and MM. Among the 2NM2^{NM} matrices AA with NN rows and MM columns where each element is 00 or 11, find the number, modulo 998244353998244353, of ones that satisfy the following condition:

  • $A_{a, b} \\times A_{c, d} \\leq A_{a, d} \\times A_{c, b}$ for every quadruple of integers (a,b,c,d)(a, b, c, d) such that 1leqa<cleqN1 \\leq a < c \\leq N and 1leqb<dleqM1 \\leq b < d \\leq M.

Constraints

  • 1leqN,Mleq4001 \\leq N, M \\leq 400
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN MM

Output

Print the answer in a single line.


Sample Input 1

2 2

Sample Output 1

13

The condition is $A_{1,1} \\times A_{2,2} \\leq A_{1,2} \\times A_{2,1}$. All 1313 matrices other than $\\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}, \\begin{pmatrix} 1 & 1 \\\\ 0 & 1 \\end{pmatrix}, \\begin{pmatrix} 1 & 0 \\\\ 1 & 1 \\end{pmatrix}$ satisfy the condition.


Sample Input 2

1 30

Sample Output 2

75497471

All 2NM2^{NM} matrices satisfy the condition, so print 2302^{30} modulo 998244353998244353, that is, 7549747175497471.


Sample Input 3

400 400

Sample Output 3

412670892