#abc281g. [abc281_g]Farthest City
[abc281_g]Farthest City
Problem Statement
You are given positive integers and .
Find the number, modulo , of simple connected undirected graphs with vertices numbered that satisfy the following condition.
- For every , the shortest distance from vertex to vertex is strictly smaller than the shortest distance from vertex to vertex .
Here, the shortest distance from vertex to vertex is the minimum number of edges in a simple path connecting vertices and .
Two graphs are considered different if and only if there are two vertices and that are connected by an edge in exactly one of those graphs.
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
4 1000000000
Sample Output 1
8
The following eight graphs satisfy the condition.
Sample Input 2
3 100000000
Sample Output 2
1
Sample Input 3
500 987654321
Sample Output 3
610860515
Be sure to find the number modulo .