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
#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T x, T y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
template <class T>
T euclideanDistance(T x1, T x2, T y1, T y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
template <class T>
T digitSum(T n) {
  T sum = 0;
  while (n > 0) sum += n % 10, n /= 10;
  return sum;
}
const double INF = 1e+9;
const double INFLL = 1e+18;
const double EPS = 1e-9;
const double PI = acos(-1);
const int knightDir[8][2] = {{-2, -1}, {-2, 1}, {-1, 2},  {1, 2},
                             {2, -1},  {2, 1},  {-1, -2}, {1, -2}};
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const long long int MOD = 998244353;
int arr[1000005];
long long int fact(long long int n) {
  long long int res = 1;
  for (long long int i = 2; i <= n; i++) res = res * i;
  return res;
}
long long int nCr(long long int n, long long int r) {
  return fact(n) / (fact(r) * fact(n - r));
}
int main() {
  long long int a, b;
  scanf("%lld%lld", &a, &b);
  if (b > a) swap(a, b);
  printf("%lld\n", nCr(a, b));
}
