#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long LL;
const int kN = 5e5+10;
const int MOD = 998244353;
int fact[kN];
int N, num[kN];
int pow(int d, int k) {
if (!k) return 1;
int t = pow(d, k/2);
t = 1ll*t*t%MOD;
if (k%2) t = 1ll*t*d%MOD;
return t;
}
int C(int n, int m) {
if (n < m) return 0;
return 1ll*fact[n] * pow(fact[n-m], MOD-2)%MOD * pow(fact[m], MOD-2)%MOD;
}
int main () {
freopen("asm_formation.in", "r", stdin);
freopen("asm_formation.out", "w", stdout);
fact[0] = 1;
for (int i = 1; i < kN; i++) fact[i] = 1ll*i*fact[i-1] % MOD;
scanf("%d", &N);
for (int i = 1; i <= N; i++) scanf("%d", &num[i]);
int ans = 1;
int sum = 0;
for (int i = 1; i <= N; i++) {
sum += num[i];
ans = 1ll*C(sum-1, num[i]-1)*ans % MOD;
}
printf("%d\n", ans);
return 0;
}