#include <bits/stdc++.h>
using namespace std;
int num[1005];
long long flag[100005];
const int mod = 1000000007;
int init() {
  flag[0] = 1;
  flag[1] = 1;
  for (int i = 2; i <= 1000; i++) {
    flag[i] = (1LL * flag[i - 1] * i) % mod;
  }
  return 0;
}
long long ppow(long long a, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) {
      ans = ans * a % mod;
    }
    a = (a * a) % mod;
    y >>= 1;
  }
  return ans;
}
int solve(long long l, long long c) {
  return (flag[l] % mod) * ppow((flag[c] * flag[l - c]) % mod, mod - 2) % mod;
}
int main() {
  int n;
  init();
  while (scanf("%d", &n) != EOF) {
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &num[i]);
      ans += num[i];
    }
    long long sum = 1;
    for (int i = n; i >= 2; i--) {
      sum = (sum * solve((ans - 1), 1LL * num[i] - 1)) % mod;
      ans -= num[i];
    }
    cout << sum << endl;
  }
  return 0;
}
