You are given two sets of vertices such that the first set contains vertices labeled to and the second set contains vertices labeled to .
Add edges between these vertices such that no two vertices from the same set are adjacent and each vertex is incident on at least one edge. Find out the number of graphs that can be formed under the above constraints.
CONSTRAINTS:
INPUT:
A single line containing two integers and .
OUTPUT:
A single integer denoting the answer. Since the answer can be large, output it modulo .
Denote a pair as an edge where u is a vertex from the first set and v from the second.
Then the edge sets for the 7 graphs are: