#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:2000000")
long long k, a[1024][1024], dp[1024], b[1024];
void f() {
  for (long long i = 0; i < (long long)1024; i++) a[i][0] = a[i][i] = 1;
  for (long long i = (long long)2; i < (long long)1024; i++)
    for (long long j = (long long)1; j < (long long)i; j++)
      a[i][j] = ((a[i - 1][j - 1] + a[i - 1][j]) % (1000 * 1000 * 1000 + 7));
}
int main() {
  cin >> k;
  for (long long i = (long long)1; i < (long long)k + 1; i++) cin >> b[i];
  f();
  memset(dp, 0, sizeof dp);
  dp[1] = 1;
  long long t = b[1];
  for (long long i = (long long)2; i < (long long)k + 1; i++) {
    dp[i] = (dp[i - 1] * a[t + b[i] - 1][t]) % (1000 * 1000 * 1000 + 7);
    t += b[i];
  }
  cout << dp[k] % (1000 * 1000 * 1000 + 7) << endl;
  return 0;
}
