#include <bits/stdc++.h>
using namespace std;
long long C[1001][1001];
const int mod = 1e9 + 7;
void calc() {
  for (int i = 0; i < 1001; i++) C[i][0] = C[i][i] = 1;
  for (int i = 1; i < 1001; i++)
    for (int j = 1; j < i; j++)
      C[i][j] = ((C[i - 1][j - 1] % mod) + (C[i - 1][j] % mod)) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  calc();
  int n;
  cin >> n;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    v.push_back(x);
  }
  long long cnt = v[0];
  long long res = 1;
  for (int i = 1; i < n; i++) {
    cnt += v[i];
    res = (res * C[cnt - 1][v[i] - 1]) % mod;
  }
  cout << res << endl;
  return 0;
}
