#include #include #include #include #include #include #include #include #define DB puts("D") #define pb push_back using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18; const double dINF = 1e18; const ld ldINF = 1e18; const double EPS = 1e-6; template void caut(T a, U b, O c){cout<<"("< void caut(T a, U b){cout<<"("< void caut(T a){cout<<"("< void input(T a[], int n){for(int i=0;i>a[i];} template void input(T a[], U b[], int n){for(int i=0;i>a[i]>>b[i];} template void input(T a[], U b[], O[], int n){for(int i=0;i>a[i]>>b[i];} using P=pair; const ll M = 998244353; int main() { int n,q; cin>>n>>q; ll p[n+1][n+1]; fill(p[0],p[n+1],0LL); p[0][0]=1; ll a[n],b[q]; input(a,n); input(b,q); for(int i=0;i