#includeusing namespace std;long long int C[100][100] = {}, A[20][100] = {};const long long int mod = 1e9 + 7;void init() { C[0][0] = 1; for (int i = 1; i < 90; ++i) { C[i][0] = C[i][i] = 1; for (int j = 1; j < i; ++j) { C[i][j] = C[i - 1][j - 1] + C[i - 1][j]; C[i][j] = C[i][j] >= mod ? C[i][j] - mod : C[i][j]; } }}long long int F(int x,int target, int t,int cnt) { long long int cnt0 = cnt - t,ans=0; for (int i = 0; i < t; ++i) { int tt = t - i,targett=target-i; if (targett <= x) ans+= C[x][x - targett] * C[cnt0 - x][tt - (x - targett)] * C[t-1][i]; } return ans;}int main() { init(); int k,t; cin >> k; int cnt = 1; A[0][0] =1; for (int i = 1; i <= k;++i) { cin >> t; cnt += t; for (int j = 0; j <= cnt; ++j) { for (int idx = max(0,j-t); idx <= j + t; ++idx) { if(A[i-1][idx]) A[i][j] = (A[i][j]+A[i - 1][idx]*F(idx, j,t,cnt))%mod; } if (j == 0 && i == k) { cout << A[k][0]; return 0; } } }}