Why does YahAHa always like cubes?
YahAHa has a special cube. Each side of cube has a number $x$ $(1\le x\le 1000)$. At the beginning, YahaHa placed the cube on the table. Then rolled the cube $n$ $(1\le n\le 2\times 10^5$ ) times, each time along one edge of bottom side.It means rotate top face to other faces.
YahAHa have a number $x$,$x$ is $1$ in the beginning.After each roll, YahAHa multiply the number on the front side of the cube to $x$. The product was so large that YahAHa write down the product module $998244353$.
Carelessly, YahAHa forgot $m$ $(1\le m\le 20)$ of these rolling directions. But YahAHa has written down the start state of the cube, the final state, and the product of numbers on the front side after module.
Can you tell YahAHa that how many different ways of rolling that satisfy all the conditions?