#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
long long a[1000009]={0},b[1000009]={0};
long long invp(int a,int n)
{
if(a==1 || n==0)return 1;
if(n==1)return a;
long long t=invp(a,n/2);
t=(t*t)%mod;
if(n&1)
t=(t*a)%mod;
return t;
}
void initnum()
{
a[1]=a[0]=1;
b[0]=b[1]=1;
for(int i=2;i<=1000006;i++)
a[i]=(a[i-1]*i)%mod;
b[1000007]=1;
for(int i=2;i<=1000007;i++)
b[1000007]=(b[1000007]*invp(i,mod-2))%mod;
for(int i=1000006;i>=2;i--)
b[i]=(b[i+1]*(i+1))%mod;
}
long long ncr(int n,int r)
{
return (((a[n]*b[r])%mod)*b[n-r])%mod;
}
int main()
{
initnum();
// initdenum();
int k;
cin>>k;
int c[1009]={0};
for(int i=1;i<=k;i++)cin>>c[i];
long long dp[1009]={0};
dp[1]=1;
int sum=c[1];
for(int i=2;i<=k;i++)
{
dp[i]=dp[i-1];
if(c[i]>1)dp[i]=(dp[i]*ncr(sum+c[i]-1,c[i]-1))%mod;
sum+=c[i];
}
cout<<dp[k]<<endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbW9kIDEwMDAwMDAwMDcKbG9uZyBsb25nIGFbMTAwMDAwOV09ezB9LGJbMTAwMDAwOV09ezB9Owpsb25nIGxvbmcgaW52cChpbnQgYSxpbnQgbikKewoJaWYoYT09MSB8fCBuPT0wKXJldHVybiAxOwoJaWYobj09MSlyZXR1cm4gYTsKCWxvbmcgbG9uZyB0PWludnAoYSxuLzIpOwoJdD0odCp0KSVtb2Q7CglpZihuJjEpCgl0PSh0KmEpJW1vZDsKCXJldHVybiB0Owp9CnZvaWQgaW5pdG51bSgpCnsKCWFbMV09YVswXT0xOwoJYlswXT1iWzFdPTE7Cglmb3IoaW50IGk9MjtpPD0xMDAwMDA2O2krKykKCQlhW2ldPShhW2ktMV0qaSklbW9kOwoJYlsxM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