#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
int n, m, a[110], ans;
void dfs(int x, int lst) {
if(x == n + 1) {
ans ++;
if(ans >= mod) {
ans -= mod;
}
return ;
}
for(int i = 1; i <= m; i ++) {
if(a[i] && i != lst) {
a[i] --;
dfs(x + 1, i);
a[i] ++;
}
}
}
signed main() {
freopen("color.in", "r", stdin);
freopen("color.out", "w", stdout);
cin >> m;
for(int i = 1; i <= m; i ++) {
cin >> a[i];
n += a[i];
}
dfs(1, 0);
cout << ans;
return 0;
}