There are N children, numbered 1,2,\ldots,N. In the next K days, we will give them some cookies. In the i-th day, we will choose a_i children among the N with equal probability, and give one cookie to each child chosen. (We make these K choices independently.)

Let us define the happiness of the children as c_1 \times c_2 \times \ldots \times c_N, where c_i is the number of cookies received by Child i in the K days. Find the expected happiness multiplied by \binom{N}{a_1} \times \binom{N}{a_2} \times \ldots \times \binom{N}{a_K} (we can show that this value is an integer), modulo (10^{9}+7).

Constraints

* 1 \leq N \leq 1000
* 1 \leq K \leq 20
* 1 \leq a_i \leq N

Input

Input is given from Standard Input in the following format:


N K
a_1 a_2 \ldots a_K


Output

Print the answer.

Examples

Input

3 2
3 2


Output

12


Input

856 16
399 263 665 432 206 61 784 548 422 313 848 478 827 26 398 63


Output

337587117
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define ll long long
//#define cccgift
//#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
//char buf[1<<21],*p1=buf,*p2=buf;
template<typename T>
inline void read(T &x)
{
    static char ch;bool f=1;
    for(x=0,ch=getchar();!isdigit(ch);ch=getchar()) if(ch=='-') f=0;
    for(;isdigit(ch);x=(x<<1)+(x<<3)+(ch^48),ch=getchar());x=f?x:-x;
}
template<typename T>
void print(T x)
{
    if (x<0) x=-x,putchar('-');
    if (x>9) print(x/10);
    putchar(x%10+48);
}
template<typename T>
inline void print(T x,char ap) {print(x);if (ap) putchar(ap);}
template<typename T>
inline void chkmax(T &x,const T &y) {x=x<y?y:x;}
template<typename T>
inline void chkmin(T &x,const T &y) {x=x<y?x:y;}
const int mod=1e9+7;
int n,k,a[21],f[1001],fac[1001],inv[1001],g[1001];
#define inc(x,y) x+=y,x>=mod?x-=mod:0
inline int C(int x,int y) {
	if(x<y||x<0||y<0) return 0;
	return (ll)fac[x]*inv[y]%mod*inv[x-y]%mod;
}
inline int kuai(int p,int q,int mod) {int tot=1;for(;q;p=(ll)p*p%mod,q>>=1) if(q&1) tot=(ll)tot*p%mod;return tot;}
int main()
{
	read(n),read(k);
	for(res i=1;i<=k;++i) read(a[i]);
	fac[0]=1;
	for(res i=1;i<=n;++i) fac[i]=(ll)fac[i-1]*i%mod;
	inv[n]=kuai(fac[n],mod-2,mod);
	for(res i=n-1;~i;--i) inv[i]=(ll)inv[i+1]*(i+1)%mod;
	f[0]=1;
	for(res i=1;i<=k;++i) {
	  memset(g,0,sizeof(g));
	  for(res j=0;j<=a[i];++j)
	    for(res l=n;l>=j;--l) inc(g[l],(ll)f[l-j]*C(n-j,a[i]-j)%mod*inv[j]%mod);
	  memcpy(f,g,sizeof(g));
	}
	print((ll)f[n]*fac[n]%mod,'\n');
	return 0;
}
/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do something instead of nothing and stay organized
*/ 