#include <bits/stdc++.h>
using namespace std;
void Clearing_out() { return; }
template <typename Head, typename... Tail>
void Clearing_out(Head &H, Tail &...T) {
  H.clear();
  Clearing_out(T...);
}
long long int extendedEuclid(long long int A, long long int B, long long int &x,
                             long long int &y) {
  if (B == 0) {
    x = 1;
    y = 0;
    return A;
  } else {
    long long int x1, y1;
    long long int gcd = extendedEuclid(B, A % B, x1, y1);
    y = x1 - (A / B) * y1;
    x = y1;
    return gcd;
  }
}
long long int mi(long long int A, long long int M) {
  long long int x, y;
  extendedEuclid(A, M, x, y);
  if (x < 0) {
    x += M;
  }
  return x;
}
const long long int nax = 3e5 + 5;
long long int fact[nax];
void F() {
  fact[0] = 1;
  for (long long int i = 1; i < nax; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 998244353;
  }
}
long long int nCr(long long int n, long long int r, long long int M) {
  if (n < r) return 0;
  return (((fact[n] * mi(fact[r], M)) % M) * mi(fact[n - r] % M, M)) % M;
}
inline long long int add(long long int val1, long long int val2) {
  long long int ans = val1 + val2;
  if (ans >= 998244353) {
    ans -= 998244353;
  }
  return ans;
}
inline long long int sub(long long int val1, long long int val2) {
  long long int ans = val1 - val2;
  if (ans < 0) {
    ans += 998244353;
  }
  return ans;
}
inline long long int mult(long long int val1, long long int val2) {
  long long int ans = (val1 * 1LL * val2) % 998244353;
  return ans;
}
long long int power(long long int base, long long int val) {
  base = base % 998244353;
  long long int res = 1;
  while (val > 0) {
    if ((val & 1)) {
      res = mult(res, base);
    }
    base = mult(base, base);
    val = (val >> 1);
  }
  return res;
}
const long long int N = 505;
long long int dp[N][N];
long long int n, x;
long long int recur(long long int damage, long long int left) {
  if (left == 0) {
    return 1;
  }
  if (damage >= x || left == 1) {
    return 0;
  }
  if (dp[damage][left] != -1) {
    return dp[damage][left];
  }
  dp[damage][left] = 0;
  for (long long int i = 0; i <= left; i++) {
    long long int option = min(x - damage, left - 1);
    dp[damage][left] =
        add(dp[damage][left],
            mult(nCr(left, i, 998244353),
                 mult(power(option, i), recur(damage + left - 1, left - i))));
  }
  return dp[damage][left];
}
void testcase() {
  cin >> n >> x;
  memset(dp, -1, sizeof(dp));
  cout << recur(0, n) << "\n";
  return;
}
int32_t main() {
  long long int test = 1;
  F();
  long long int t = 0;
  while (test--) {
    testcase();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}

### Prompt

Create a solution in CPP for the following problem:

There are n heroes fighting in the arena. Initially, the i-th hero has a_i health points.

The fight in the arena takes place in several rounds. At the beginning of each round, each alive hero deals 1 damage to all other heroes. Hits of all heroes occur simultaneously. Heroes whose health is less than 1 at the end of the round are considered killed.

If exactly 1 hero remains alive after a certain round, then he is declared the winner. Otherwise, there is no winner.

Your task is to calculate the number of ways to choose the initial health points for each hero a_i, where 1 ≤ a_i ≤ x, so that there is no winner of the fight. The number of ways can be very large, so print it modulo 998244353. Two ways are considered different if at least one hero has a different amount of health. For example, [1, 2, 1] and [2, 1, 1] are different.

Input

The only line contains two integers n and x (2 ≤ n ≤ 500; 1 ≤ x ≤ 500).

Output

Print one integer — the number of ways to choose the initial health points for each hero a_i, where 1 ≤ a_i ≤ x, so that there is no winner of the fight, taken modulo 998244353. 

Examples

Input


2 5


Output


5


Input


3 3


Output


15


Input


5 4


Output


1024


Input


13 37


Output


976890680

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void Clearing_out() { return; }
template <typename Head, typename... Tail>
void Clearing_out(Head &H, Tail &...T) {
  H.clear();
  Clearing_out(T...);
}
long long int extendedEuclid(long long int A, long long int B, long long int &x,
                             long long int &y) {
  if (B == 0) {
    x = 1;
    y = 0;
    return A;
  } else {
    long long int x1, y1;
    long long int gcd = extendedEuclid(B, A % B, x1, y1);
    y = x1 - (A / B) * y1;
    x = y1;
    return gcd;
  }
}
long long int mi(long long int A, long long int M) {
  long long int x, y;
  extendedEuclid(A, M, x, y);
  if (x < 0) {
    x += M;
  }
  return x;
}
const long long int nax = 3e5 + 5;
long long int fact[nax];
void F() {
  fact[0] = 1;
  for (long long int i = 1; i < nax; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 998244353;
  }
}
long long int nCr(long long int n, long long int r, long long int M) {
  if (n < r) return 0;
  return (((fact[n] * mi(fact[r], M)) % M) * mi(fact[n - r] % M, M)) % M;
}
inline long long int add(long long int val1, long long int val2) {
  long long int ans = val1 + val2;
  if (ans >= 998244353) {
    ans -= 998244353;
  }
  return ans;
}
inline long long int sub(long long int val1, long long int val2) {
  long long int ans = val1 - val2;
  if (ans < 0) {
    ans += 998244353;
  }
  return ans;
}
inline long long int mult(long long int val1, long long int val2) {
  long long int ans = (val1 * 1LL * val2) % 998244353;
  return ans;
}
long long int power(long long int base, long long int val) {
  base = base % 998244353;
  long long int res = 1;
  while (val > 0) {
    if ((val & 1)) {
      res = mult(res, base);
    }
    base = mult(base, base);
    val = (val >> 1);
  }
  return res;
}
const long long int N = 505;
long long int dp[N][N];
long long int n, x;
long long int recur(long long int damage, long long int left) {
  if (left == 0) {
    return 1;
  }
  if (damage >= x || left == 1) {
    return 0;
  }
  if (dp[damage][left] != -1) {
    return dp[damage][left];
  }
  dp[damage][left] = 0;
  for (long long int i = 0; i <= left; i++) {
    long long int option = min(x - damage, left - 1);
    dp[damage][left] =
        add(dp[damage][left],
            mult(nCr(left, i, 998244353),
                 mult(power(option, i), recur(damage + left - 1, left - i))));
  }
  return dp[damage][left];
}
void testcase() {
  cin >> n >> x;
  memset(dp, -1, sizeof(dp));
  cout << recur(0, n) << "\n";
  return;
}
int32_t main() {
  long long int test = 1;
  F();
  long long int t = 0;
  while (test--) {
    testcase();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}

```