#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long C[1001][1001];
void PreCalc() {
  C[0][0] = 1;
  for (int i = 1; i < 1001; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= i; ++j) {
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
    }
  }
}
int main() {
  PreCalc();
  int k;
  scanf("%d", &k);
  int n = 0;
  vector<int> c(k);
  for (int i = 0; i < k; ++i) {
    scanf("%d", &c[i]);
    n += c[i];
  }
  long long ans = 1;
  for (int i = k - 1; i >= 0; --i) {
    ans *= C[n - 1][c[i] - 1];
    ans %= mod;
    n -= c[i];
  }
  cout << ans;
}
