#include #include namespace my{ void main(); void solve(); } int main(){my::main();} namespace my{ #define eb emplace_back #define LL(...) ll __VA_ARGS__;lin(__VA_ARGS__) #define VL(n,...) vec__VA_ARGS__;setsize({n},__VA_ARGS__);lin(__VA_ARGS__) #define FO(n) for(ll ij=0;ijconcept vectorial=is_base_of_v,V>; templatestruct core_type{using type=T;}; templatestruct core_type{using type=typename core_type::type;}; templateistream&operator>>(istream&i,vector&v){fe(v,e)i>>e;return i;} templateostream&operator<<(ostream&o,const vector&v){fe(v,e)o<?nl:sp);return o;} templatestruct vec:vector{ using vector::vector; vec(const vector&v){this->reserve(v.size());fe(v,e)this->eb(e);} vec&operator+=(const vec&u){vec&v=*this;fo(i,v.size())v[i]+=u[i];return v;} vec&operator-=(const vec&u){vec&v=*this;fo(i,v.size())v[i]-=u[i];return v;} vec&operator^=(const vec&u){this->insert(this->end(),u.begin(),u.end());return*this;} vec operator+(const vec&u)const{return vec{*this}+=u;} vec operator-(const vec&u)const{return vec{*this}-=u;} vec operator^(const vec&u)const{return vec{*this}^=u;} vec&operator++(){fe(*this,e)++e;return*this;} vec&operator--(){fe(*this,e)--e;return*this;} vec operator-()const{vec v=*this;fe(v,e)e=-e;return v;} }; templateauto make_vec(const ll(&s)[n],T x={}){if constexpr(n==i+1)return vec(s[i],x);else{auto X=make_vec(s,x);return vec(s[i],X);}} templatevoid setsize(const ll(&l)[n],A&...a){((a= make_vec(l,typename core_type::type())),...);} void io(){cin.tie(nullptr)->sync_with_stdio(0);cout<>...>>a);} templatevoid pp(const auto&...a){ll n=sizeof...(a);((cout<0,c)),...);cout<=N)a-=N;return*this;} auto&operator-=(const modll&b){if(ull(a+=N-b.a)>=N)a-=N;return*this;} auto&operator*=(const modll&b){(a*=b.a)%=N;return*this;} auto&operator/=(const modll&b){return*this*=b.inv();} friend auto operator+(const modll&a,const modll&b){return modll{a}+=b;} friend auto operator-(const modll&a,const modll&b){return modll{a}-=b;} friend auto operator*(const modll&a,const modll&b){return modll{a}*=b;} friend auto operator/(const modll&a,const modll&b){return modll{a}/=b;} friend bool operator==(const modll&a,const modll&b){return a.a==b.a;} auto operator-()const{return N-a;} modll inv()const{ assert(gcd(a,N)==1); ll a=this->a,b=N,u=1,v=0; while(b)swap(u-=a/b*v,v),swap(a-=a/b*b,b); return u; } ll val()const{return a;} friend istream&operator>>(istream&i,modll&b){ull t;i>>t;b=t;return i;} friend ostream&operator<<(ostream&o,const modll&b){return o<T mod(T a,T m){return(a%=m)<0?a+m:a;} void main(){io();ll T=1;fo(T)solve();} void solve(){ LL(N,K); VL(K,a); ll mod=100000000000000007LL; modll::set_mod(mod); vecdp(N); dp[0]=1; fo(i,N){ fo(j,K)if(i+a[j]