#include <bits/stdc++.h>
using namespace std;
inline bool cheak(int x, int y, int xMax, int yMax) {
  return x >= 0 && y >= 0 && xMax > x && yMax > y;
}
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1},
          dy[8] = {0, -1, 0, 1, -1, 1, -1, 1};
const int mod = 1000000007;
const int INF = 1e9;
const int M = 1001;
long long C[M][M];
int main() {
  C[0][0] = C[1][1] = C[1][0] = 1;
  for (int i = 2; i < M; i++) {
    for (int j = 0; j <= i; ++j) {
      long long l = j >= i ? 0 : C[i - 1][j];
      long long r = j > 0 ? C[i - 1][j - 1] : 0;
      C[i][j] = (l + r) % mod;
    }
  }
  int k;
  cin >> k;
  int c[1001];
  int sum = 0;
  int ans = 1;
  for (long long(i) = (0); i < (k); (i)++) {
    cin >> c[i];
  }
  for (long long(i) = (0); i < (k); (i)++) sum += c[i];
  for (int i = k - 1; i >= 1; i--) {
    ans = (ans * C[sum - 1][c[i] - 1]) % mod;
    sum -= c[i];
  }
  cout << ans << endl;
  return 0;
}
