Bins and balls
There are n bins in a row. There is also an infinite supply of balls of n distinct colors. Place exactly one ball into each bin, with the restriction that adjacent bins cannot contain balls of the same color. How many valid configurations of balls in bins are there?
One integer n (1 ≤ n ≤
Print the number of valid configurations of balls in bins modulo
109 + 7.