//Link : https://atcoder.jp/contests/dwacon6th-prelims/tasks/dwacon6th_prelims_c

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 20
#define M 1001
#define mod 1000000007
int a[N];
int combi[M][M],invFactorial[M];

int add(int x,int y) {
    int ret = x+y;
    if(ret>=mod) {
        ret -= mod;
    }
    return ret;
}

int mul(int x,int y) {
    return (ll)x*y%mod;
}

int mypow(int x,int c) {
    int ret = 1;
    while(c>0) {
        if(c&1) {
            ret = mul(ret,x);
        }
        c/=2;
        x = mul(x,x);
    }
    return ret;
}

void init() {
    invFactorial[0] = 1;
    int f = 1;
    for(int i=1;i<M;++i) {
        f = mul(f,i);
        invFactorial[i] = mypow(f,mod-2);
    }
    for(int i=0;i<M;++i) {
        combi[i][i] = combi[i][0] = 1;
        for(int j = 1;j<i;++j) {
            combi[i][j] = add(combi[i-1][j-1],combi[i-1][j]);
        }
    }
}

int dp[N][M];

int solveDp(int ind,int rem,int k,int n) {
    if(ind==k) {
        return rem==n ? 1 : 0;
    }
    int &ret = dp[ind][rem];
    if(ret!=-1) {
        return ret;
    }
    ret = 0;
    for(int i=0;rem +i<=n && i<=a[ind];++i) {
        int tmp = mul(invFactorial[i], combi[n-i][a[ind]-i]);
        ret = add(ret, mul(tmp, solveDp(ind+1,rem+i,k,n)));
    }
    return ret;
}

void solve() {
    int n,k;scanf("%d %d",&n,&k);
    init();
    int fac = 1;
    for(int i=0;i<k;++i) {
      scanf("%d",&a[i]);
    }
    for(int i=2;i<=n;++i) {
        fac = mul(fac,i);
    }
    memset(dp,-1,sizeof(dp));
    int ret = mul(fac,solveDp(0,0,k,n));
    printf("%d\n",ret);
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}
