You have an unlimited number of blocks of each size 1×N, 2×N, …, N×N. Use them to fill a rectangle of N rows and M columns with no gaps.
A block can be turned by 90∘. That is, a k×N block can be placed as k rows by N columns, or as N rows by k 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 1999.