import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { new Main().run(); } final long MOD=998244353; void run() { FastScanner sc=new FastScanner(); int N=sc.nextInt(); int Q=sc.nextInt(); long[] A=new long[N]; for (int i=0;i=0;--j) { dp[j]=((j==0?0:dp[j-1])+(A[i]-1)*dp[j]%MOD)%MOD; } } for (int i=0;i Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} }