#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, m, num[5000007], inv[10000007], g[10000007], f[10000007], res;
int read() {
  int num = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') num = num * 10 + c - '0', c = getchar();
  return num;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) num[i] = read(), m += num[i];
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= max(n, m); i++)
    inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
  g[1] = mod + 1 - n;
  for (int i = 1; i < m; i++)
    g[i + 1] = 1LL * (1LL * i * g[i] % mod - m + mod) % mod * (n - 1) % mod *
               inv[m - i] % mod;
  for (int i = m; i >= 1; i--) f[i - 1] = (f[i] - g[i] + mod) % mod;
  for (int i = 1; i <= n; i++) res = (res + f[num[i]]) % mod;
  res = 1LL * (res - 1LL * (n - 1) * f[0] % mod + mod) % mod * inv[n] % mod;
  cout << res << endl;
  return 0;
}
