#import #import #define F(n)for(int i=0;i>n>>q;vector v(1<<18,vector{1LL});F(n)cin>>a,v[i]={a-1,1};F(18)F(1<<17)v[i]=atcoder::convolution(v[2*i],v[2*i+1]);F(q)cin>>a,cout<