#include <bits/stdc++.h>
using namespace std;
const int ModD = 1e9 + 7;
long long n, a[1005], f[1005], c[1005][1005], d[1005][1005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= 1000; ++i) d[0][i] = 1, c[0][i] = 1;
  for (int i = 1; i <= 1000; ++i)
    for (int j = 1; j <= 1000; ++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]) % ModD;
    }
  int so = a[1];
  f[1] = 1;
  for (int i = 2; i <= 1000; ++i) {
    f[i] = (f[i - 1] * c[a[i] - 1][so + 1]) % ModD;
    so += a[i];
  }
  cout << f[n];
  fclose(stdin);
  fclose(stdout);
}
