#include <bits/stdc++.h>
long long inf = (long long)1E17;
long mod(long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0) return c;
  return c + (long long)(1E9 + 7);
}
long long po(long a, long b) {
  if (b == 0) {
    return 1;
  }
  long long z = po(a, b / 2);
  z = mod(z * z);
  if (b % 2 != 0) {
    z = mod(a * z);
  }
  return z;
}
const int SIZE = 1010;
long long inv[SIZE + 1];
long long kai[SIZE + 1];
long long invkai[SIZE + 1];
const int MOD = (long long)(1E9 + 7);
void invinit() {
  inv[1] = 1;
  for (int i = 2; i <= SIZE; i++) {
    inv[i] = MOD - ((MOD / i) * inv[MOD % i]) % MOD;
  }
  kai[0] = invkai[0] = 1;
  for (int i = 1; i <= SIZE; i++) {
    kai[i] = (kai[i - 1] * i) % MOD;
    invkai[i] = (invkai[i - 1] * inv[i]) % MOD;
  }
}
long long comb(long long a, long long b) {
  if (b < 0 || a < b) {
    return 0;
  }
  return mod(kai[a] * mod(invkai[b] * invkai[a - b]));
}
int main() {
  invinit();
  using namespace std;
  long long n, k;
  cin >> n >> k;
  long long a[k];
  long long s = 0;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    s += a[i];
  }
  long long e = po(inv[n] * s, n);
  long long ans = e;
  for (int i = 0; i < k; i++) {
    ans *= comb(n, a[i]);
    ans = mod(ans);
  }
  cout << ans << endl;
  return 0;
}
