Dog Card is a card game. In the game, there are a total of
2n2n2n cards in the deck, each card has a value, and the values of these
2n2n2n cards form a permutation of
1∼2n1\sim 2n1∼2n. There is a skill that works as follows:
-
Draw a card from the top of the deck.
-
If the deck is empty, then skip to step 333, otherwise you guess whether the card on the top of the deck has a higher value than your last drawn card and draw a card from the top of the deck. If your guess is correct, then repeat this step, otherwise skip to step 3.
-
End this process.
Nana enjoys playing this game, although she may not be skilled at it. Therefore, her guessing strategy when using this skill is simple: if the value of the last drawn card is less than or equal to
nnn, then she guesses that the next card's value is higher; otherwise, she guesses that the next card's value is lower. She wants to know, for all different decks of cards (Obviously, there are
(2n)!(2n)!(2n)! cases), how many cards she can draw in total if she uses the skill only once in each case. Since this number can be very large, please provide the answer modulo a given value.