Problem: We have a square grid with N rows and M columns. Takahashi will write an integer in each of the squares, as follows:

* First, write 0 in every square.
* For each i=1,2,...,N, choose an integer k_i (0\leq k_i\leq M), and add 1 to each of the leftmost k_i squares in the i-th row.
* For each j=1,2,...,M, choose an integer l_j (0\leq l_j\leq N), and add 1 to each of the topmost l_j squares in the j-th column.



Now we have a grid where each square contains 0, 1, or 2. Find the number of different grids that can be made this way, modulo 998244353. We consider two grids different when there exists a square with different integers.

Constraints

* 1 \leq N,M \leq 5\times 10^5
* N and M are integers.

Input

Input is given from Standard Input in the following format:


N M


Output

Print the number of different grids that can be made, modulo 998244353.

Examples

Input

1 2


Output

8


Input

2 3


Output

234


Input

10 7


Output

995651918


Input

314159 265358


Output

70273732

Solution (in CPP):

Solution:
#include <bits/stdc++.h>

using namespace std;

#define fst first
#define snd second
#define mp make_pair
#define squ(x) ((LL)(x) * (x))
#define debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long LL;
typedef pair<int, int> pii;

template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }

template<typename T> inline T read() {
	T sum = 0, fg = 1; char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') fg = -1;
	for (; isdigit(c); c = getchar()) sum = (sum << 3) + (sum << 1) + (c ^ 0x30);
	return fg * sum;
}

const int maxn = 5e5 + 10;
const int mod = 998244353;

int n, m;

inline void Add(int &x, int y) { y += (y < 0 ? mod : 0), x += y, x -= (x >= mod ? mod : 0); }
inline int Pow(int x, int y) {
	int res = 1;
	for (; y; y >>= 1, x = squ(x) % mod) if (y & 1) res = (LL) res * x % mod;
	return res;
}

int fac[maxn], ifac[maxn];
inline void init(int N) {
	fac[0] = 1;
	for (int i = 1; i <= N; i++) fac[i] = (LL) fac[i - 1] * i % mod;
	ifac[N] = Pow(fac[N], mod - 2);
	for (int i = N - 1; ~i; i--) ifac[i] = (LL) ifac[i + 1] * (i + 1) % mod;
}
inline int C(int _n, int _m) { return (LL) fac[_n] * ifac[_n - _m] % mod * ifac[_m] % mod ; }

inline int f(int k) { return (LL) C(n, k) * C(m, k) % mod * fac[k] % mod * Pow(m + 1, n - k) % mod * Pow(n + 1, m - k) % mod; }

int main() {
#ifdef xunzhen
	freopen("calc.in", "r", stdin);
	freopen("calc.out", "w", stdout);
#endif

	n = read<int>(), m = read<int>(), init(max(n, m));

	int ans = 0;
	for (int i = 0, e = min(n, m); i <= e; i++) Add(ans, (i & 1 ? -1 : 1) * f(i));
	cout << ans << endl;

	return 0;
}