#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
inline long long read(register long long a = 0, register char ch = getchar()) {
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9')
    a = (a << 3) + (a << 1) + (ch ^ 48), ch = getchar();
  return a;
}
long long inv[5000010 << 1], f[5000010 << 1], a[5000010], b[5000010], n, m, ans;
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++) a[i] = read(), m += a[i];
  inv[1] = inv[0] = 1;
  for (long long i = 2; i <= max(n, m); i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  for (long long i = 1; i < m; i++)
    f[i + 1] = ((-1ll * (m - i) * (n - 2) % mod * inv[n - 1] % mod + mod + m) %
                    mod * f[i] % mod -
                1ll * i * (f[i - 1] + 1) % mod + mod) %
               mod * (n - 1) % mod * inv[m - i] % mod;
  for (long long i = 1; i <= n; i++) ans = (0ll + ans + f[a[i]] + mod) % mod;
  cout << (ans - f[m] + mod) % mod << endl;
}
