#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
struct P {
  double x, y;
  P() {}
  P(int x, int y) : x(double(x)), y(double(y)) {}
  P(double x, double y) : x(x), y(y) {}
  P operator+(const P &a) const { return P(x + a.x, y + a.y); }
  P operator-(const P &a) const { return P(x - a.x, y - a.y); }
  double operator^(const P &a) const { return x * a.x + y * a.y; }
  void in() { scanf("%lf%lf", &x, &y); }
  void out() { printf("REQUIRED %.7f %.7f\n", x, y); }
  double dist(P a, P b) {
    return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  }
  double sqdist(P a, P b) {
    return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
  }
};
int n, a[2001];
long long mu(long long a, long long p) {
  if (p == 0) return 1;
  long long t = mu(a, p / 2);
  t = t * t % 1000000007;
  if (p % 2) t = t * a % 1000000007;
  return t;
}
long long way = 1;
long long tot = 0;
long long ch(long long n, long long k) {
  long long base = 1;
  for (int i = (1); i <= (k); i++) {
    base = base * (n - i + 1) % 1000000007;
    base = base * mu(i, 1000000007 - 2) % 1000000007;
  }
  return base;
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) scanf("%d", &a[i]);
  for (int i = (1); i <= (n); i++) {
    a[i]--;
    long long slot = tot + 1;
    way = way * ch(slot + a[i] - 1, a[i]) % 1000000007;
    tot += (a[i] + 1);
  }
  cout << way << endl;
  return 0;
}
