Graph Transformation
Time limit1sMemory limit1024 MB
Given a complete graph with N vertices, find the vertex count after K line-graph transformations, modulo 1000000007.
Problem
The transformation of a graph is defined as follows. Treat each edge of as a vertex of . Connect two vertices of with an edge when the corresponding edges are adjacent in . Two distinct edges are adjacent if they share at least one common vertex.

The transformed graph can be transformed again.
Find the number of vertices of the graph obtained by transforming an -complete graph times. An -complete graph is a graph with vertices in which every pair of distinct vertices is joined by an edge.
Input
The first line contains integers and , separated by a space. (, )
Output
Print the remainder when the number of vertices of the graph after transformations is divided by . This number is prime.