After gaining a lot of knowledge, you decided to write a knowledge-oriented problem.
You are given an undirected graph G with n vertices and m edges. You copy it k times and denote the copies by G1, G2, . . . , Gk. You add edges between vertex u in copy Gi and the same vertex u in copy Gi+1 for all 1 ≤ i ≤ k−1 and 1 ≤ u ≤ n.
Find the number of spanning trees of the new graph. The answer can be large, so output it modulo 109 + 7.