AT_abc432_g [ABC432G] Sum of Binom(A, B)

Description

You are given a sequence of positive integers $ A=(A_1,A_2,\dots,A_N) $ of length $ N $ and a sequence of positive integers $ B=(B_1,B_2,\dots,B_M) $ of length $ M $ . Find the value of $ \displaystyle \sum_{i=1}^{N} \sum_{j=1}^{M} \binom{A_i}{B_j} $ , modulo $ 998244353 $ . Here, $ \displaystyle \binom{x}{y} $ represents the number of ways to choose $ y $ objects from $ x $ objects (binomial coefficient), and particularly, it is $ 0 $ if $ x < y $ .

Input Format

The input is given from Standard Input in the following format: > $ N $ $ M $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $ $ B_1 $ $ B_2 $ $ \dots $ $ B_M $

Output Format

Output the answer.

Explanation/Hint

### Sample Explanation 1 The answer is $ \displaystyle \binom{2}{1}+\binom{2}{3}+\binom{5}{1}+\binom{5}{3}+\binom{4}{1}+\binom{4}{3}=2+0+5+10+4+4=25 $ . ### Constraints - $ 1\leq N,M \leq 5\times 10^5 $ - $ 1\leq A_i,B_j \leq 5\times 10^5 $ - All input values are integers.