#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
const int MAXN = 10 * 1000 * 1000 + 10, MAXV = 4;
long long GCD(long long a, long long b) {
  return (a % b) == 0 ? b : GCD(b, a % b);
}
long long mod(long long x) { return ((x % 998244353 + 998244353) % 998244353); }
bool cmp(const pair<int, int> &left, const pair<int, int> &right) {
  return left.first > right.first ||
         (left.first == right.first && left.second < right.second);
}
long long mem[1005][1005];
int main() {
  long long n, m, a, b, c, i, j, k, mx = 0, ans = 1;
  long long ar[1005];
  cin >> k;
  for (i = 1; i <= k; i++) {
    scanf("%lld", &ar[i]);
  }
  mem[0][0] = 1;
  for (i = 1; i <= 1000; i++) {
    mem[i][0] = 1;
    for (j = 1; j <= 1000; j++) {
      mem[i][j] = (mem[i - 1][j - 1] + mem[i - 1][j]) % MOD;
    }
  }
  for (i = 1; i <= k; i++) mx += ar[i];
  for (i = k; i >= 1; i--) {
    ans = (ans * mem[mx - 1][ar[i] - 1]) % MOD;
    mx -= ar[i];
  }
  cout << ans << endl;
  return 0;
}
