#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register int data = 0, w = 1;
  char ch = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    data = (data << 1) + (data << 3) + (ch ^ 48), ch = getchar();
  return data * w;
}
int n, a[1000005], g[1000005], inv[1000005], f[1000005];
const int mod = 998244353, M = 3e5;
int main() {
  n = read();
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= M; i++)
    inv[i] = 1ll * inv[mod % i] * (mod - mod / i) % mod;
  int s = 0;
  for (int i = 1; i <= n; i++) a[i] = read(), s += a[i];
  g[0] = n - 1;
  for (int i = 1; i <= s - 1; i++)
    g[i] = (1ll * (n - 1) * s + 1ll * i * (n - 1) % mod * g[i - 1]) % mod *
           inv[s - i] % mod;
  f[s] = 0;
  for (int i = s - 1; i >= 0; i--) f[i] = (g[i] + f[i + 1]) % mod;
  int C = f[0];
  int sum = 0;
  for (int i = 1; i <= n; i++) sum = (sum + f[a[i]]) % mod;
  int ans = (sum - 1ll * C * (n - 1) % mod + mod) * inv[n] % mod;
  cout << ans << '\n';
  return 0;
}
