Iceberg House, a trading house, is a highly desirable workplace for young scholars thanks to its renowned reputation throughout the markets. Each year, Yessine receives a vast pool of apprenticeship seekers. In the past, he would select candidates arbitrarily. However, this year, he has learned from travelers along the Silk Road that trading houses with diverse knowledge and skills are more successful in negotiating profitable deals with merchants from distant lands.
To enhance diversity, Yessine has identified a list of $$$n$$$ skills. Each candidate has a proficiency score for each skill, ranging from $$$1$$$ (lowest proficiency) to $$$m$$$ (highest proficiency).
To ensure a diverse selection, Yessine will choose candidates such that no applicant is more skilled than another. However, if two or more candidates are equally skilled, then Yessine will only select one of them.
A candidate $$$A$$$ is more skilled than $$$B$$$ if, for every skill, candidate $$$A$$$ has a proficiency score greater than or equal to candidate $$$B$$$, and for at least one skill, candidate $$$A$$$ has a strictly higher proficiency score. Two candidates are equally skilled if they have exactly the same proficiency scores for all skills.
Yessine wants to maximize the number of young scholars while still adhering to the selection criteria described above.
The applicant pool is very large and contains every possible combination of skill scores. What is the maximum number of candidates Yessine can accept while ensuring no candidate is more skilled than another?
Since the answer can be large, output it modulo $$$M = 998244353$$$.
The single line of the input contains two space separated integers:
Output one integer, representing the desired answer modulo $$$998244353$$$
10 10
432457640
3 20
300
100 100
920143000
200 200
441305744