#include <bits/stdc++.h>
inline int getint() {
  int x = 0, p = 1;
  char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int mod = 998244353;
inline void reduce(int &x) { x += x >> 31 & mod; }
inline int mul(int x, int y) { return 1ll * x * y % mod; }
const int N = 3e5 + 5;
int n, a[N], f[N];
int modpow(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = mul(ans, x);
    x = mul(x, x);
    y >>= 1;
  }
  return ans;
}
int modinv(int x) { return modpow(x, mod - 2); }
int main() {
  n = getint();
  int s = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    a[i] = getint();
    s += a[i];
  }
  for (int(x) = 0; (x) < (s); (x)++) {
    reduce(f[x] += mul(s - x, n - 1) - mod);
    if (x) reduce(f[x] += mul(x, mul(n - 1, f[x - 1] + 1)) - mod);
    int ans = mul(s, n - 1);
    reduce(ans -= mul(s - x, n - 2));
    reduce(ans -= mul(x, n - 1));
    f[x] = mul(f[x], modinv(ans));
  }
  for (int i = 1; i < s; i++) reduce(f[i] += f[i - 1] - mod);
  int res = 0;
  for (int(i) = 0; (i) < (n); (i)++) reduce(res -= (a[i] ? f[a[i] - 1] : 0));
  reduce(res += f[s - 1] - mod);
  cout << mul(res, modinv(n)) << endl;
  return 0;
}
