#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
const int N = 300005, mod = 998244353;
int Pow(int x, int y) {
  int ans = 1;
  for (; y; y >>= 1, x = (long long)x * x % mod)
    if (y & 1) ans = (long long)ans * x % mod;
  return ans;
}
void Add(int &x, int y) {
  if ((x += y) >= mod) x -= mod;
}
void Del(int &x, int y) {
  if ((x -= y) < 0) x += mod;
}
int Add(int x) { return x >= mod ? x - mod : x; }
int Del(int x) { return x < 0 ? x + mod : x; }
int n, s;
int a[N];
int p[N], q[N];
int main() {
  n = read(), s = 0;
  for (int i = (1); i <= (n); i++) a[i] = read(), s += a[i];
  if (s == 1) return puts("0"), 0;
  p[0] = n - 1;
  int invn = Pow(n - 1, mod - 2);
  for (int i = (1); i <= (s - 1); i++) {
    int v = (long long)i * Pow(s, mod - 2) % mod;
    int mv = Del(1 - v);
    p[i] = ((long long)p[i - 1] * v + 1) % mod *
           Pow((long long)mv * invn % mod, mod - 2) % mod;
  }
  q[s] = 0;
  for (int i = (s - 1); i >= (0); i--) q[i] = Add(p[i] + q[i + 1]);
  int ans = Del(-(long long)(n - 1) * q[0] % mod);
  for (int i = (1); i <= (n); i++) Add(ans, q[a[i]]);
  ans = (long long)ans * Pow(n, mod - 2) % mod;
  cout << ans << endl;
  return 0;
}
