An undirected graph on n vertices whose vertices are labeled with the distinct numbers 1,2,…,n is called a symmetric labeled cliquer when it satisfies both of the following conditions:
Maurycy has drawn every symmetric labeled cliquer that can be built on n labeled vertices. He now wants to grade each drawing with one integer from the set {1,2,…,m} (two different cliquers may receive the same grade). In how many different ways can he assign the grades? Because the answer can be very large, print it modulo 109−401.
The picture below shows every symmetric labeled cliquer for n=4.

A single line contains two integers n and m (1≤n≤2⋅109, 1≤m≤2⋅109), separated by one space: the number of vertices of each symmetric labeled cliquer and the number of available grades.
Print, on a single line, the number of ways to assign the grades, taken modulo 109−401.