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>
#define rgi register int
#define ll long long
namespace IO {
#define _CCF_ 8388608
// #define getchar() (_Ip1==_Ip2&&(_Ip2=(_Ip1=_I)+fread(_I,1,1<<21,stdin),_Ip1==_Ip2)?EOF:*_Ip1++)
// #define putchar(c) (_Op-_O<_CCF_)?(*_Op++=c):(fwrite(_O,_Op-_O,1,stdout),_Op=_O,*_Op++=c)
	char _I[_CCF_],*_Ip1=_I,*_Ip2=_I,_O[_CCF_],*_Op=_O;
	int _f,_ch,_On[32],_Oh; long long _k;
	template<typename _T> inline void read(_T&_x){
		_x=_f=_ch=0; while(!isdigit(_ch)) _f|=(_ch=='-'),_ch=getchar();
		while(isdigit(_ch)) _x=(_x<<1)+(_x<<3)+(_ch^'0'),_ch=getchar();
		_f&&(_x=-_x);}
	template<typename _T> inline void write(_T _x){
		if(_x==0) return putchar('0'),void(); if(_x<0) putchar('-'),_x=-_x;
		while(_x>0) _k=_x/10,_On[++_Oh]=(_x-(_k<<1)-(_k<<3))^'0',_x=_k;
		while(_Oh>0) putchar(_On[_Oh]),--_Oh;}
	inline void _Exit0() {fwrite(_O,_Op-_O,1,stdout),exit(0);}
} using namespace IO;
const int maxn=500004,mod=998244353;

int inv[maxn];
inline int powmod(ll a,int b) {
	ll res=1;
	while(b>0) {
		if(b&1) (res*=a)%=mod;
		(a*=a)%=mod,b>>=1;
	} return res;
}
inline int calc(int n,int m) {
	ll res=0,fact=1,bn=1,bm=1,pn=powmod(n+1,m),pm=powmod(m+1,n);
	for(rgi i=0;i<=n;++i) {
		(res+=((i&1)?(mod-1ll):1ll)*fact%mod*bn%mod*bm%mod*pn%mod*pm)%=mod;
		(bn*=(ll)(n-i)*inv[i+1]%mod)%=mod,(bm*=(ll)(m-i)*inv[i+1]%mod)%=mod;
		(pn*=inv[n+1])%=mod,(pm*=inv[m+1])%=mod;
		(fact*=i+1)%=mod;
	} return res;
}
signed main() {
	// rgi T,n,m,a,b; read(T);
	// inv[1]=1; for(rgi i=2;i<maxn;++i) inv[i]=(ll)(mod-mod/i)*inv[mod%i]%mod;
	// while(T--) {
	// 	read(n),read(m),read(a),read(b);
	// 	if(a!=0&&(a==b||a==-b)) write(calc(n,m));
	// 	else write((a?powmod(m+1,n):1)*(b?powmod(n+1,m):1)%mod);
	// 	putchar('\n');
	// } _Exit0();
	int n,m; read(n),read(m);
	inv[1]=1; for(rgi i=2;i<maxn;++i) inv[i]=(ll)(mod-mod/i)*inv[mod%i]%mod;
	write(calc(std::min(n,m),std::max(n,m))),_Exit0();
}