Games

아직 제출이 없습니다시간 제한4초메모리 제한1024 MB

문제

You are given an integer sequence A_1,A_2,,A_NA\_1,A\_2,\ldots,A\_N and an integer KK.

You'll prepare KK piles of stones. Each pile should contain exactly A_iA\_i piles for some ii. All piles are distinguishable; there are NKN^K different configurations.

You and Mike will play a game with the piles. You and Mike alternately do the following operation, with you going first.

  • Choose at most 66 piles (choosing 00 piles is not allowed) and remove an arbitrary positive number of stones from each of the chosen piles. Note that the player can remove different numbers of stones from different piles.

The player who cannot make a valid move loses. Assuming both players play optimally, count the number of initial configurations that result in your loss, modulo 998244353998244353.

입력

The first line contains integers NN (1N1001 \leq N \leq 100) and KK (1K10181 \leq K \leq 10^{18}).

The second line contains integers A_1,A_2,,A_NA\_1,A\_2,\ldots,A\_N (1A_1<A_2<<A_N1001 \leq A\_1 < A\_2 < \cdots < A\_N \leq 100).

출력

Print the answer.