Blocks 3

Count the tilings of an N by M rectangle using blocks of size k by N for any k, allowing 90-degree rotation, modulo 1999.

Medium7Dynamic programmingCombinatoricsMathMatrixNo attempts yetTime limit1sMemory limit256 MB

Problem

You fill a rectangle completely with blocks. For each of the 1×N1 \times N, 2×N2 \times N, ..., N×NN \times N blocks you have an unlimited supply.

Fill a rectangle of height NN and width MM with these blocks. Blocks must not overlap and must not stick out of the rectangle. A block may be rotated by 90 degrees, so a k×Nk \times N block can be placed as kk rows by NN columns, or as NN rows by kk columns.

Count the ways to fill the rectangle and print that count modulo 1999. Two ways are different when at least one cell is covered by a block sitting in a different place.

Input

The first line contains NN and MM, separated by a space. (1N1031 \le N \le 10^3, 1M1061 \le M \le 10^6)

Output

Print the number of ways to fill the rectangle, modulo 1999.