FLWRS - Flowers

题意翻译

给定 $N,M$,求有多少长为 $N$ 的排列满足相邻元素差的绝对值均不为 $1$。 答案对 $M$ 取模。 $0<N\le 2000$。

题目描述

Hanadi has **N** flower pots each with a unique flower. The pots are arranged along in a line. One day, She decided to change their order under the condition that no two pots that were originally next to each other remain next to each other. ### Task write a program that is given the number of pots, calculates the number of possible orders satisfying the condition **modulo a given integer M**. ### Constraints **1** N 2,000 The number of pots. **2** M 1,000,000,000

输入输出格式

输入格式


- Line 1 contains the integer **N**, the number of flower pots. - Line 2 contains the integer **M**.

输出格式


A single line containing one integer between 0 and **M-1** (inclusive): the number of possible orders modulo **M**.

输入输出样例

输入样例 #1

\n5
11

输出样例 #1

\n3