luogu#P5005. 中国象棋 - 摆上马
中国象棋 - 摆上马
Background
Believe in your method, shout "I won't MLE!", and you will pass this problem.
Imakf got tired of playing international chess and decided to try Chinese chess.
He found that the horse in Chinese chess is different from the knight in international chess. He realized this could make another easy problem, so he decided to place horses again.
Problem Description
Imakf has a board with rows and columns, and many identical horses (you may assume there are infinitely many). Now place horses on the board (or place none). Find the total number of ways such that no horse can attack another horse.
The horse in Chinese chess is different from the knight in international chess.

Note: In the actual problem, there are no pawns.
Since the number of ways may be too large, output the value modulo .
Input Format
The first line contains two positive integers .
Output Format
Output the number of ways modulo .
1 1
2
3 3
145
Hint
For 100% of the data, , .
For 20% of the data, .
For another 20% of the data, .
For Sample 1, you may choose to place none or place horses.
For Sample 2, I have a brilliant explanation, but unfortunately I cannot fit it here.
Translated by ChatGPT 5