#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
long long c[1100][1100];
int main() {
  int n, x;
  cin >> n;
  cin >> x;
  long long ans = 1, sum = x;
  c[1][1] = c[1][0] = 1;
  for (int i = 2; i <= 1000; i++)
    for (int j = 0; j <= i; j++) {
      if (j == 0) c[i][j] = 1;
      c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
      c[i][j] %= Mod;
    }
  for (int i = 1; i < n; i++) {
    cin >> x;
    long long res = c[sum + x - 1][sum];
    ans *= res;
    ans %= Mod;
    sum += x;
  }
  cout << ans << endl;
  return 0;
}
