#include <bits/stdc++.h>
using namespace std;
int dp[1001][1001];
int M = 1e9 + 7;
void init() {
  for (int i = 1; i < 1001; i++) {
    dp[1][i] = 1;
    dp[i][1] = i;
  }
  for (int i = 2; i < 1001; i++)
    for (int j = 2; j < 1001; j++) dp[i][j] = (dp[i][j - 1] + dp[i - 1][j]) % M;
}
int main() {
  init();
  vector<int> c(1001);
  int k;
  cin >> k;
  for (int i = 0; i < k; i++) cin >> c[i];
  int x = c[0];
  unsigned long long res = 1;
  for (int i = 1; i < k; i++) {
    if (c[i] != 1) res = (res * dp[x + 1][c[i] - 1]) % M;
    x += (c[i]);
  }
  cout << res;
}
