#include <bits/stdc++.h>
using namespace std;
long long MOD = 998244353;
long long powmod(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b & 1) {
    return (powmod(a, b - 1) * a) % MOD;
  }
  long long P = powmod(a, b >> 1);
  return (P * P) % MOD;
}
vector<long long> fact;
vector<long long> inv;
long long combs(long long n, long long k) {
  return ((fact[n] * inv[k]) % MOD * inv[n - k]) % MOD;
}
int main() {
  long long n, x;
  cin >> n >> x;
  fact = inv = vector<long long>(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
  inv[n] = powmod(fact[n], MOD - 2);
  for (long long i = n - 1; i >= 0; --i) {
    inv[i] = ((i + 1) * inv[i + 1]) % MOD;
  }
  vector<vector<long long>> dp(n + 1, vector<long long>(x + 1));
  for (long long i = 0; i <= x; ++i) {
    dp[0][i] = 1;
  }
  vector<vector<long long>> power(max(n, x) + 1,
                                  vector<long long>(max(n, x) + 1));
  for (long long i = 0; i <= max(n, x); ++i) {
    for (long long j = 0; j <= max(n, x); ++j) {
      if (j == 0) {
        power[i][j] = 1;
      } else {
        power[i][j] = (power[i][j - 1] * i) % MOD;
      }
    }
  }
  for (long long i = 2; i <= n; ++i) {
    for (long long j = 1; j <= x; ++j) {
      if (i > j) {
        dp[i][j] = power[j][i];
        continue;
      }
      for (int cnt = 0; cnt <= i; ++cnt) {
        dp[i][j] += ((dp[cnt][j - i + 1] * power[i - 1][i - cnt]) % MOD *
                     combs(i, cnt)) %
                    MOD;
        if (dp[i][j] >= MOD) {
          dp[i][j] -= MOD;
        }
      }
    }
  }
  cout << dp[n][x];
}

### Prompt

Construct a CPP code solution to the problem outlined:

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;
long long MOD = 998244353;
long long powmod(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b & 1) {
    return (powmod(a, b - 1) * a) % MOD;
  }
  long long P = powmod(a, b >> 1);
  return (P * P) % MOD;
}
vector<long long> fact;
vector<long long> inv;
long long combs(long long n, long long k) {
  return ((fact[n] * inv[k]) % MOD * inv[n - k]) % MOD;
}
int main() {
  long long n, x;
  cin >> n >> x;
  fact = inv = vector<long long>(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
  inv[n] = powmod(fact[n], MOD - 2);
  for (long long i = n - 1; i >= 0; --i) {
    inv[i] = ((i + 1) * inv[i + 1]) % MOD;
  }
  vector<vector<long long>> dp(n + 1, vector<long long>(x + 1));
  for (long long i = 0; i <= x; ++i) {
    dp[0][i] = 1;
  }
  vector<vector<long long>> power(max(n, x) + 1,
                                  vector<long long>(max(n, x) + 1));
  for (long long i = 0; i <= max(n, x); ++i) {
    for (long long j = 0; j <= max(n, x); ++j) {
      if (j == 0) {
        power[i][j] = 1;
      } else {
        power[i][j] = (power[i][j - 1] * i) % MOD;
      }
    }
  }
  for (long long i = 2; i <= n; ++i) {
    for (long long j = 1; j <= x; ++j) {
      if (i > j) {
        dp[i][j] = power[j][i];
        continue;
      }
      for (int cnt = 0; cnt <= i; ++cnt) {
        dp[i][j] += ((dp[cnt][j - i + 1] * power[i - 1][i - cnt]) % MOD *
                     combs(i, cnt)) %
                    MOD;
        if (dp[i][j] >= MOD) {
          dp[i][j] -= MOD;
        }
      }
    }
  }
  cout << dp[n][x];
}

```