#include <bits/stdc++.h>
using namespace std;
long long int triangle[5000 + 1][5000 + 1];
void makeTriangle() {
  int i, j;
  triangle[0][0] = 1;
  for (i = 1; i < 5000; i++) {
    triangle[i][0] = 1;
    for (j = 1; j <= i; j++) {
      triangle[i][j] =
          (triangle[i - 1][j - 1] + triangle[i - 1][j]) % 1000000007;
    }
  }
}
long long int C(long long int n, long long int r) { return triangle[n][r]; }
int main() {
  int k;
  makeTriangle();
  scanf("%d", &k);
  int a[1005], f[1005], i;
  f[0] = 0;
  for (i = 1; i <= k; i++) {
    scanf("%d", &a[i]);
    f[i] = f[i - 1] + a[i];
  }
  int long long ans = 1;
  for (i = 2; i <= k; i++) {
    ans = (ans * C(f[i] - 1, a[i] - 1)) % 1000000007;
  }
  cout << ans;
  return 0;
}
