The Romanian word "popeală" has its origins in a Romanian historical novella, "Alexandru Lăpușneanul", where the eponymous Prince of Moldavia uses a variation of the term to describe his upcoming revenge on his usurpers. The term was recently revived, somewhat surprisingly, in the Romanian programming contest scene. It's used to describe any situation in which the scientific committee makes life harder for the contestants in an unorthodox and (usually) involuntary way: very strict time limits, invalid test cases, wrong statements,wrong statements, stealing keyboards and other such mechanisms. This task is about such a "popeală". Source : CEOI 2016 , Romania
GrandPaPà is very upset that nobody liked his problems in the past InfoLeague™ contest. He wants to take revenge for that **insert Pablo Escobar**. He gives you nicely throws you number N. He then asks you nicely orders you to find the number of permutations of length N such that the maximum size of a subsequence ( contiguous indices ) that only has consecutive values is exactly equal to K. For example , [1, 2, 3, 4] would satisfy K = 4 ( [1, 4] is the best subsequence ) while [3, 1, 2, 4] will satisfy K = 2 ( [2, 3] is the best subsequence ). If you can solve this task , GrandPaPà will be happy once again. Else he will **redacted**.
The input consists of two integers N (1 ≤ N ≤ 2000) — the length of the permutations, and MOD (1 ≤ MOD ≤ 109) — the modulo used to compute the answer.
The output consists of N integers , the number of permutations which hold the propriety for every K in the set {1,2,3...,N}. This means you need to solve the problem for every possible K and print the answers. Since the answers may be very large, print them modulo MOD.
3 666013
3 2 1
Let's look at all the permutations of length 3.
Thus , we need to print [3 mod 666013 , 2 mod 666013 , 1 mod 666013] = [3,2,1].
| Name |
|---|


