#include const int Mod = 998244353; long long div_mod(long long x, long long y, long long z) { if (x % y == 0) return x / y; else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y; } int main() { int C, X; scanf("%d %d", &C, &X); if (X == 0) { if (C == 0) printf("1\n"); else printf("499122177\n"); fflush(stdout); return 0; } int i, j, cur, prev; long long dp[2][2003] = {}, inv[2003]; for (i = 1; i <= X + 1; i++) inv[i] = div_mod(1, i, Mod); for (i = C, cur = 1, prev = 0, dp[prev][0] = 1; i < X; i++, cur ^= 1, prev ^= 1) { for (j = 0; j <= i; j++) { dp[cur][j] += dp[prev][j] * j % Mod * inv[i+1] % Mod; dp[cur][j+1] += dp[prev][j] * (i + 1 - j) % Mod * inv[i+1] % Mod; dp[prev][j] = 0; } } long long ans = 0; for (j = 0; j < X; j++) ans += dp[prev][j] * (1 - inv[X+1-j] + Mod) % Mod; printf("%lld\n", ans % Mod); fflush(stdout); return 0; }