#include <bits/stdc++.h>
using namespace std;
const long long mxi = 501;
long long dp[mxi][mxi];
long long c[mxi][mxi];
long long mod = 998244353;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, x;
  cin >> n >> x;
  for (long long i = 0; i <= n; i++) {
    c[i][0] = c[i][i] = 1;
    for (long long j = 1; j < i; j++) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
  for (long long i = 1; i <= x; i++) {
    dp[1][x - i] = i;
  }
  for (long long i = 2; i <= n; i++) {
    for (long long j = x - 1; j >= 0; j--) {
      long long um = 1;
      long long to = min(x, j + (i - 1));
      for (long long k = 0; k <= i; k++) {
        long long cc = dp[i - k][to];
        cc *= c[i][k];
        cc %= mod;
        cc *= um;
        cc %= mod;
        dp[i][j] += cc;
        dp[i][j] %= mod;
        um *= (to - j);
        um %= mod;
      }
    }
  }
  long long ans = dp[n][0];
  long long uy = 1;
  for (long long i = 0; i < n; i++) {
    uy *= x;
    uy %= mod;
  }
  cout << (uy - ans + mod) % mod;
}

### Prompt

Please formulate a cpp solution to 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;
const long long mxi = 501;
long long dp[mxi][mxi];
long long c[mxi][mxi];
long long mod = 998244353;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, x;
  cin >> n >> x;
  for (long long i = 0; i <= n; i++) {
    c[i][0] = c[i][i] = 1;
    for (long long j = 1; j < i; j++) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
  for (long long i = 1; i <= x; i++) {
    dp[1][x - i] = i;
  }
  for (long long i = 2; i <= n; i++) {
    for (long long j = x - 1; j >= 0; j--) {
      long long um = 1;
      long long to = min(x, j + (i - 1));
      for (long long k = 0; k <= i; k++) {
        long long cc = dp[i - k][to];
        cc *= c[i][k];
        cc %= mod;
        cc *= um;
        cc %= mod;
        dp[i][j] += cc;
        dp[i][j] %= mod;
        um *= (to - j);
        um %= mod;
      }
    }
  }
  long long ans = dp[n][0];
  long long uy = 1;
  for (long long i = 0; i < n; i++) {
    uy *= x;
    uy %= mod;
  }
  cout << (uy - ans + mod) % mod;
}

```