← Back to Problems
Every Venue Filled
Easy standard Combinatorics
Time limit: 2 s per test  ·  Memory: 256 MB

Your desk must route n orders to m trading venues. Every order is sent to exactly one venue.

Count the routings in which every venue receives at least one order. Since the count can be enormous, output it modulo 998244353.

Input

Two integers n and m.

Output

One integer: the number of routings that use every venue at least once, modulo 998244353. If no such routing exists, output 0.

Constraints

1 <= n <= 10^9

1 <= m <= 10^5

Scoring

This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.

Examples

input
3 2
output
6
input
2 3
output
0
Python 3.13 i Execution environment Isolated microVM · 1 vCPU · no internet access Time and memory limits are set per problem Available packages numpy 2.5.0scipy 1.18.0pandas 3.0.0scikit-learn 1.9.0statsmodels 0.15.0cvxpy 1.9.2