p03914 CODE FESTIVAL 2016 Final - Road of the King
There are N towns in Takahashi Kingdom. They are conveniently numbered 1 through N.

Takahashi the king is planning to go on a tour of inspection for M days. He will determine a sequence of towns c, and visit town c_i on the i-th day. That is, on the i-th day, he will travel from his current location to town c_i. If he is already at town c_i, he will stay at that town. His location just before the beginning of the tour is town 1, the capital. The tour ends at town c_M, without getting back to the capital.

The problem is that there is no paved road in this kingdom. He decided to resolve this issue by paving the road himself while traveling. When he travels from town a to town b, there will be a newly paved one-way road from town a to town b.

Since he cares for his people, he wants the following condition to be satisfied after his tour is over: "it is possible to travel from any town to any other town by traversing roads paved by him". How many sequences of towns c satisfy this condition?

Constraints

* 2≦N≦300
* 1≦M≦300

Input

The input is given from Standard Input in the following format:


N M


Output

Print the number of sequences of towns satisfying the condition, modulo 1000000007 (=10^9+7).

Examples

Input

3 3


Output

2


Input

150 300


Output

734286322


Input

300 150


Output

0
```python
mod=10**9+7

N,M=map(int,input().split())
dp=[[0 for i in range(N+1)] for j in range(N+1)]
dp[N][N]=1

for i in range(M-1,-1,-1):
    for k in range(1,N+1):
        for j in range(k,N+1):
            if j==k:
                if j<N:
                    dp[j][k]=(j*dp[j][k]+(N-j)*dp[j+1][k])%mod
                else:
                    dp[j][k]=(N*dp[j][k])%mod
            else:
                if j<N:
                    dp[j][k]=(k*dp[j][j]+(N-j)*dp[j+1][k]+(j-k)*dp[j][k])%mod
                else:
                    dp[j][k]=(k*dp[j][j]+(N-k)*dp[j][k])%mod

print(dp[1][1])

```