#include<cstdio> usingnamespace std; typedeflonglong LL; template <classType> voidread(Type &x) { char c; bool flag = false; while ((c = getchar()) < '0' || c > '9') c == '-' && (flag = true); x = c - '0'; while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0'; flag && (x = ~x + 1); } template <classType> voidwrite(Type x) { x < 0 && (putchar('-'), x = ~x + 1); x > 9 && (write(x / 10), 0); putchar(x % 10 + '0'); } constint N = 1e5 + 10, mod = 998244353; int n, m, s; intbinpow(int b, int k) { int res = 1; while (k) { if (k & 1) res = (LL)res * b % mod; b = (LL)b * b % mod; k >>= 1; } return res; } intC(int a, int b) { if (a < b) return0; int res = 1, inv = 1; for (int i = a; i > a - b; i--) res = (LL)res * i % mod; for (int i = b; i; i--) inv = (LL)inv * i % mod; return (LL)res * binpow(inv, mod - 2) % mod; } intlucas(int a, int b) { if (!a || !b) return1; return (LL)C(a % mod, b % mod) * lucas(a / mod, b / mod) % mod; } intmain() { read(n), read(m), read(s); s -= m; int res = 1; for (int i = 1, a; i < n; i++) { read(a); s -= a; if (s < 0) { puts("0"); return0; } res = (LL)res * lucas(a + m - 1, m - 1) % mod; } res = (LL)res * lucas(s + m - 1, m - 1) % mod; write(res); return0; }