#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkMin(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
inline void checkMax(T &a, T b) {
  if (a < b) a = b;
}
const int MOD = 1e9 + 7;
int c[1024][1024];
int k, num[1024], tot[1024];
long long solve(int i) {
  return i < 0 ? 1 : c[num[i] - 1][tot[i] - 1] * solve(i - 1) % MOD;
}
int main() {
  for (int i = 0; i < int(1024); ++i) {
    for (int j = 0; j < int(i + 1); ++j) {
      c[j][i] = j == 0 || j == i ? 1 : c[j - 1][i - 1] + c[j][i - 1];
      if (c[j][i] >= MOD) c[j][i] -= MOD;
    }
  }
  scanf("%d", &k);
  for (int i = 0; i < int(k); ++i) {
    scanf("%d", &num[i]);
    tot[i] = i == 0 ? num[i] : tot[i - 1] + num[i];
  }
  printf("%d\n", (int)solve(k - 1));
  return 0;
}
