import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.NoSuchElementException; import java.util.PriorityQueue; public class Main { public static void main(String[] args) { new Main().run(); } class State implements Comparable{ int id; int col; int num; public State(int id,int col,int num) { this.id=id; this.col=col; this.num=num; } @Override public int compareTo(State o) { return -Integer.compare(col, o.col); } } final long MOD=998244353; void run() { FastScanner sc=new FastScanner(); int N=sc.nextInt(); int Q=sc.nextInt(); long[] A=new long[N+1]; long[] ans=new long[Q]; long[] prd=new long[N+1]; for (int i=0;i=0;--i) prd[i]=prd[i+1]*A[i]%MOD; PriorityQueue pq=new PriorityQueue<>(); for (int i=0;i=0;--j) { dp[j]=((j==0?0:dp[j-1])+(A[i]-1)*dp[j]%MOD)%MOD; } } PrintWriter pw=new PrintWriter(System.out); for (int i=0;i Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} }