#include <bits/stdc++.h>
using namespace std;
long long dp[1005];
int ncr[1005][1005];
void ncrcal(int n, int MOD) {
  for (int i = 0; i <= n; i++) ncr[i][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i; j++)
      ncr[i][j] = (ncr[i - 1][j - 1] + ncr[i - 1][j]) % MOD;
}
int main() {
  int n, c[1005];
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  ncrcal(1001, 1000000007);
  int total = 0;
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    ans = (ans * ncr[total + c[i] - 1][c[i] - 1]) % 1000000007;
    total += c[i];
  }
  cout << ans << "\n";
  return 0;
}
