#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 2;
const int mod = 998244353;
void add(int &x, int y) {
  x += y;
  if (x >= mod) {
    x -= mod;
  }
}
void sub(int &x, int y) {
  x -= y;
  if (x < 0) {
    x += mod;
  }
}
int mul(int x, int y) { return (1ll * x * y) % mod; }
int binpow(int x, int y) {
  int tich = 1;
  while (y) {
    if (y & 1) {
      tich = mul(tich, x);
    }
    x = mul(x, x);
    y >>= 1;
  }
  return tich;
}
int ar[N], dp[N], suff[N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, i, j, k, l, s = 0, sum = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> ar[i];
    s += ar[i];
  }
  dp[0] = n - 1;
  for (i = 1; i < s; i++) {
    dp[i] = mul(mul(mul(dp[i - 1], i) + s, n - 1), binpow(s - i, mod - 2));
  }
  for (i = s - 1; i > -1; i--) {
    suff[i] = suff[i + 1];
    add(suff[i], dp[i]);
  }
  for (i = 1; i <= n; i++) {
    add(sum, suff[ar[i]]);
  }
  sub(sum, mul(suff[0], n - 1));
  cout << mul(binpow(n, mod - 2), sum);
}
