#P2386. The task of harmony

The task of harmony

题目描述

In today's society we should pay attention to the problem of harmony, but everyone has his own personality, if the personality does not match will cause disputes, but Pikachu is a very kind mouse, he wants to make social disputes become less, so he asked for help from you smart, please write a program to help Pikachu calculate the number of people who will affect the distribution of harmony

A place has n consecutive rooms numbered from 1 to n. Each room has one occupant.There are m personalities, of which each person may be one.

输入格式

One line containing two integers m and n.

输出格式

The number of states that may generate social disputes is obtained by taking the remainder of 1e9+7.

样例

2 3
6

提示

By TOP

1≤m≤1e8,1≤n≤1e12

There are two groups of test samples, one small sample and one large sample