#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  vector<int> x;
  int sum = 0;
  for (int i = 0; i < k; i++) {
    int t;
    cin >> t;
    sum += t;
    x.push_back(t);
  }
  unsigned long v[1005][1005];
  v[0][0] = 1;
  v[0][1] = 1;
  v[0][2] = 0;
  for (int i = 1; i < sum; i++) {
    v[i][0] = 1;
    for (int j = 0; j < i + 1; j++) {
      v[i][j + 1] = (v[i - 1][j + 1] + v[i - 1][j]) % 1000000007;
    }
    v[i][i + 2] = 0;
  }
  unsigned long long int p = 1;
  for (int i = 0; i < k - 1; i++) {
    p = (p * v[sum - 2][x[k - i - 1] - 1]) % 1000000007;
    sum = sum - x[k - i - 1];
  }
  cout << p << endl;
}
