#include <bits/stdc++.h>
using namespace std;
const int base = 1e9 + 7;
const int maxn = 2005;
long long n, a[maxn], f[maxn], c[maxn][maxn], d[maxn][maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= 2000; ++i) d[0][i] = 1, c[0][i] = 1;
  for (int i = 1; i <= 2000; ++i)
    for (int j = 1; j <= 2000; ++j) {
      if (j == 1)
        c[i][j] = 1;
      else
        c[i][j] = d[i][j - 1];
      d[i][j] = (d[i - 1][j] + c[i][j]) % base;
    }
  int num = a[1];
  f[1] = 1;
  for (int i = 2; i <= 2000; ++i) {
    f[i] = (c[a[i] - 1][num + 1] * f[i - 1]) % base;
    num += a[i];
  }
  cout << f[n];
  fclose(stdin);
  fclose(stdout);
}
