#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll const MOD = 1e9 + 7;
  int const MAXN = 1001;
  int bin[MAXN][MAXN]{};
  bin[0][0] = 1;
  for (int i = 1; i < MAXN; ++i) {
    for (int j = 0; j <= i; ++j) {
      bin[i][j] = (bin[i - 1][j] + bin[i - 1][j - 1]) % MOD;
    }
  }
  int k;
  cin >> k;
  int c[MAXN];
  for (int i = 0; i < k; ++i) {
    cin >> c[i];
  }
  ll res = 1;
  ll total = 0;
  for (int i = 0; i < k; ++i) {
    res = (res * bin[total + c[i] - 1][c[i] - 1]) % MOD;
    total += c[i];
  }
  cout << res;
  return 0;
}
