#include <bits/stdc++.h>
using namespace std;
const int D = 1e9 + 7;
long long k, A[1002], F[1002], c[1002][1002], d[1002][1002];
int main() {
  cin >> k;
  for (int i = 1; i <= k; ++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]) % D;
    }
  long long so = A[1];
  F[1] = 1;
  for (int i = 2; i <= 1000; ++i) {
    F[i] = (F[i - 1] * c[A[i] - 1][so + 1]) % D;
    so += A[i];
  }
  cout << F[k];
  fclose(stdin);
  fclose(stdout);
}
