#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll mod = 1000000007;
const ll mod998 = 998244353;
const ll intmax = 2147483647;
const ll llmax = 9223372036854775807;
const char sp = ' ';
const int dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 };

int N, K, a[20];
ll DP[1001], f[1001], inv[1001];

ll pw(ll x, ll y) {
	ll a = 1;
	while (y) {
		if (y & 1)a = a*x%mod;
		x = x*x%mod;
		y /= 2;
	}
	return a;
}

ll comb(int n, int r) {
	return f[n] * inv[r] % mod*inv[n - r] % mod;
}

ll invcomb(int n, int r) {
	return inv[n] * f[r] % mod*f[n - r] % mod;
}

int main() {
	f[0] = 1;
	for (ll i = 1; i <= 1000; i++) {
		f[i] = f[i - 1] * i%mod;
	}
	for (int i = 0; i <= 1000; i++) {
		inv[i] = pw(f[i], mod - 2);
	}
	cin >> N >> K;
	for (int i = 0; i < K; i++) {
		cin >> a[i];
	}
	DP[0] = 1;
	for (int i = 0; i < K; i++) {
		for (int j = N - 1; j >= 0; j--) {
			for (int k = min(a[i], N - j); k > 0; k--) {
				DP[j + k] += DP[j] * comb(N - k, j) % mod*invcomb(N, j) % mod*comb(a[i], k);
				DP[j + k] %= mod;
			}
		}
	}
	for (int i = 0; i < K; i++) {
		DP[N] *= comb(N, a[i]);
		DP[N] %= mod;
	}
	cout << DP[N] << endl;
}