#include <bits/stdc++.h>
using std::endl;
using std::istream;
template <typename T>
T ioread(istream& in) {
  T var;
  in >> var;
  return var;
}
class Calc {
 public:
  typedef int64_t type;
  Calc(type divisor) : div_(divisor) {}
  inline type multiply(type a, type b) const { return conv(a * b); }
  inline type add(type a, type b) const { return conv(a + b); }

 private:
  inline type conv(type x) const { return (x % div_); }
  const type div_;
};
static const int MAX_BALLS = 1000;
static const int MAX_N = 2 * MAX_BALLS;
static const int MAX_K = MAX_BALLS;
static Calc::type bc[MAX_N + 1][MAX_K + 1];
class WeakCompositions {
 public:
  WeakCompositions(const Calc& calculator) : calc_(calculator) {}
  inline Calc::type ncompos(const int n, const int k) const;

 private:
  inline Calc::type combinations(const int n, const int k) const;
  const Calc& calc_;
};
inline Calc::type WeakCompositions::ncompos(int n, int k) const {
  --k;
  n += k;
  return combinations(n, k);
}
inline Calc::type WeakCompositions::combinations(int n, int k) const {
  Calc::type& coeff = bc[n][k];
  if (coeff) return coeff;
  if (k == 0 || k == n) return (coeff = 1);
  --n;
  coeff = combinations(n, k);
  --k;
  coeff = calc_.add(coeff, combinations(n, k));
  return coeff;
}
int main(void) {
  using std::cin;
  using std::cout;
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  const int K = ioread<int>(cin);
  int nballs = 0;
  Calc::type ncomb = 1;
  Calc calc((Calc::type)1e9 + 7);
  WeakCompositions wc(calc);
  for (int color = 0; color < K; ++color) {
    const int ci = ioread<int>(cin);
    ncomb = calc.multiply(ncomb, wc.ncompos(ci - 1, nballs + 1));
    nballs += ci;
  }
  cout << ncomb << endl;
  return 0;
}
