Filling a rectangle with blocks

Count the ways to tile an N by M rectangle with rectangles of size k by N for any k, each rotatable, modulo 1999.

Medium7Dynamic programmingCombinatoricsMathNo attempts yetTime limit1sMemory limit256 MB

Problem

You have an unlimited number of blocks of each size 1×N1 \times N, 2×N2 \times N, \dots, N×NN \times N. Use them to fill a rectangle of NN rows and MM columns with no gaps.

A block can be turned by 9090^\circ. That is, a k×Nk \times N block can be placed as kk rows by NN columns, or as NN rows by kk columns. Blocks must not overlap and must not stick out of the rectangle.

Two fillings count as different if any cell is covered by a block of a different position or shape. Print the number of fillings modulo 19991999.

Input

The first line contains NN and MM, separated by a space. (1N1001 \le N \le 100, 1M1041 \le M \le 10^4)

Output

Print the number of fillings modulo 19991999 on one line.