There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors.

Find the number of the possible ways to paint the balls.

Constraints

* 1≦N≦1000
* 2≦K≦1000
* The correct answer is at most 2^{31}-1.

Input

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


N K


Output

Print the number of the possible ways to paint the balls.

Examples

Input

2 2


Output

2


Input

1 10


Output

10
n,k=gets.split.map &:to_i
p (k-1)*((k-1)**(n-2))*k
#2 2=>2(1*2)
#01, 10
#3 2=>2(1*2)
#010, 101
#4 2=>2(1*2)
#0101, 1010
#5 2=>2

#2 3=>6(2*3)
#01, 02, 10, 12, 20, 21
#3 3=>12(2*2*3)
#010, 012, 020, 021, 101, 102, 120, 121, 201, 202, 210, 212
#4 3=>24(2*4*3)
#0101, 0102, 0120, 0121, 0201, 0202, 0210, 0212, 1010, 1012, 1020, 1021, 1201, 1202, 1210, 1212, 
#5 3=>48?

#2 4=>12(3*4)
#01, 02, 03, 10, 12, 13, 20, 21, 23, 30, 31, 32
#3 4=>36(3*3*4)
#010 012, 013, 020, 021, 023, 101, 102, 103, 120, 121, 123, 201, 202, 203, 210, 212, 213, 230, 231, 232, 301, 302, 303, 310, 312, 313, 320, 321, 323
#4 4=>108?(3*9*4)

#2 5=>20(4*5)
