#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int MAX = 1010;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  vector<vector<long long> > c(MAX);
  c[0].resize(MAX);
  c[0][0] = 1;
  for (int i = 1; i < MAX; i++) {
    c[i].resize(MAX);
    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 k;
  cin >> k;
  vector<int> cx(k);
  for (int i = 0; i < k; i++) cin >> cx[i];
  long long ans = 1, total = 0;
  for (int i = 0; i < k; i++) {
    ans *= (c[total + cx[i] - 1][cx[i] - 1]);
    ans %= mod;
    total += cx[i];
  }
  cout << ans % mod;
}
