Moejy0viiiiiv is collecting red envelopes on a rectangular plane. She starts at $(0,0)$. Every day at noon, she walks from $(x, y)$ to $(x,y+1)$ with probability $A/1996488707$, and to $(x+1,y)$ with probability $B/1996488707$, and stops immediately with probability $1-A/1996488707-B/1996488707$ (once she stops, she will never move again). Besides, she also stops after walking for $N$ days.
With a given constant integer $D$, there’s a red envelope at each $(xD, yD)(0 \leq x, y)$. There’re also $K$ barriers at $(x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_K, y_K)$ (barriers never coincide with red envelopes). If she walks to a barrier, she will stop immediately.
Moejy0viiiiiv will collect each red envelope she passes by (including $(0,0)$). What’s the expected number of red envelopes Moejy0viiiiiv collects after $N$ days? Output the answer $\bmod 998244353$. Notice that $1996488707 \bmod 998244353 = 1$.