New-year tree#23

New-year tree

1 second
64 megabytes
Medium
prb23

Petryk has a circular garland consisting of lamps, and he has different colors to paint them. He wants to color the garland so that no two adjacent lamps are the same color. How many ways can Petryk color the garland under this condition?

Input

The first line contains two integers and (1 \le n, k \le 15): the number of lamps and the number of colors, respectively.

Output

Print the number of possible ways to color the garland. If it is impossible to color the garland according to the described requirements, print -1.

Examples

Example 1

Loading
Loading