#include using namespace std; using ll=long long; #include using namespace atcoder; using mint=modint998244353; ll H,W; vector S; mint f(int a,int b,int A,int B){ vector> DP(H,vector (W,0)); DP[a][b]=1; for(int h=0;h>H>>W; S.resize(H); for(int i=0;i>S[i]; mint an=f(0,1,H-2,W-1)*f(1,0,H-1,W-2)-f(0,1,H-1,W-2)*f(1,0,H-2,W-1); cout<