#include <bits/stdc++.h>
using namespace std;
int a1[1001][1001];
int main() {
  for (int i = 0; i < 1001; ++i) a1[i][0] = 1;
  for (int i = 1; i < 1001; ++i)
    for (int j = 1; j <= i; ++j)
      a1[i][j] = (a1[i - 1][j - 1] + a1[i - 1][j]) % 1000000007;
  int n, k, a, b;
  long long o = 1;
  scanf("%d%d", &n, &a);
  for (int i = 1; i < n; ++i, a += b) {
    scanf("%d", &b);
    o = o * a1[a + b - 1][b - 1] % 1000000007;
  }
  printf("%d\n", o);
}
