#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
typedef long long LL;
typedef pair<int,int> pa;
typedef vector<int> vec;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
const int MO=1e9+7;
int n,k,a[222222];
LL ans,fac[200010],inv[200010],INV[200010];
LL pw(LL x,LL y){
	LL t=1;
	for (;y;y>>=1){
		if (y&1) t=t*x%MO;
		x=x*x%MO;
	}
	return t;
}
LL C(int x,int y){
	return fac[x]*inv[y]%MO*inv[x-y]%MO;
}
struct Poly{
	LL p[1010];
	Poly(){memset(p,0,sizeof(p));}
	Poly operator * (const Poly & A) const{
		Poly B;
		FOR(i,0,n)
			FOR(j,0,n-i)
				(B.p[i+j]+=p[i]*A.p[j])%=MO;
		return B;
	}
}P;
int main(){
	fac[0]=1;
	FOR(i,1,200000) fac[i]=fac[i-1]*i%MO;
	FOR(i,1,200000) INV[i]=pw(i,MO-2);
	inv[200000]=pw(fac[200000],MO-2);
	FORD(i,199999,0) inv[i]=inv[i+1]*(i+1)%MO;
	cin>>n>>k;
	FOR(i,1,k) getint(a[i]);
	P.p[0]=1;
	FOR(i,1,k){
		Poly t;
		FOR(j,0,a[i]) t.p[j]=C(n-j,a[i]-j)*inv[j]%MO;
		P=P*t;
	}
	ans=P.p[n]*fac[n]%MO;
	ans=(ans%MO+MO)%MO;
	cout<<ans<<endl;
	return 0;
}