#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using _loop_int = int;
const ll MOD = 1000000007ll;
int n;
int k;
int a[25];
ll comb[1252][1252];
ll dp[25][1252];
ll modpow(ll a, ll b) {
  ll r = 1;
  while (b) {
    if (b & 1) r = r * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return r;
}
ll modinv(ll a) { return modpow(a, MOD - 2); }
ll invcombn[1252];
int main() {
  scanf("%d%d", &n, &k);
  for (_loop_int i = 0; i < (_loop_int)(k); i++) scanf("%d", a + i);
  for (_loop_int i = 0; i < (_loop_int)(1252); i++)
    for (_loop_int j = 0; j < (_loop_int)(1252); j++) {
      if (i == 0 || j == i) {
        comb[i][j] = 1;
      } else if (j > i) {
        comb[i][j] = 0;
      } else {
        comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % MOD;
      }
    }
  for (_loop_int i = 0; i < (_loop_int)(1252); i++)
    invcombn[i] = modinv(comb[n][i]);
  dp[0][n] = 1;
  for (_loop_int i = 0; i < (_loop_int)(k); i++) {
    for (_loop_int j = 0; j < (_loop_int)(n + 1); j++)
      if (dp[i][j]) {
        for (_loop_int y = 0; y < (_loop_int)(min(j, a[i]) + 1); y++) {
          ll add = dp[i][j];
          add = add * comb[j][y] % MOD;
          add = add * comb[n - y][a[i] - y] % MOD;
          add = add * invcombn[a[i]] % MOD;
          (dp[i + 1][j - y] += add) %= MOD;
        }
      }
  }
  ll ans = dp[k][0];
  for (_loop_int i = 0; i < (_loop_int)(k); i++)
    ans = ans * comb[n][a[i]] % MOD;
  printf("%lld\n", ans);
  return 0;
}
