#include <bits/stdc++.h>
using namespace std;
int k, c[1000 + 10], sum;
long long a[1010][1000 + 10];
long long ans[1000 + 10];
const long long mod = 1000000007;
void calc() {
  for (int i = 0; i < 1000 + 10; i++) a[0][i] = 1;
  for (int i = 1; i < 1010; i++) {
    for (int j = i; j < 1000 + 10; j++) {
      a[i][j] = a[i - 1][j - 1] + a[i][j - 1];
      a[i][j] %= mod;
    }
  }
}
int main() {
  calc();
  cin >> k;
  for (int i = 1; i <= k; i++) {
    cin >> c[i];
  }
  ans[1] = 1;
  sum = c[1];
  for (int i = 2; i <= k; i++) {
    ans[i] = ans[i - 1] * a[sum][(sum + c[i] - 1)];
    ans[i] %= mod;
    sum += c[i];
  }
  cout << ans[k] << endl;
  return 0;
}
