#include <bits/stdc++.h>
using namespace std;
int n, m;
int s[600005], h[600005], k[600005], b[600005], flag[600005];
int po(int a, int b) {
  int an = 1;
  while (b != 0) {
    if (b & 1) an = (long long)an * a % 998244353;
    a = (long long)a * a % 998244353;
    b = (b >> 1);
  }
  return an;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]), m += s[i];
  for (int i = m - 1; i >= 1; i--) {
    if (flag[i + 1] == 1) {
      int t1 = (long long)(m - i) * po(m, 998244353 - 2) % 998244353 *
               po(n - 1, 998244353 - 2) % 998244353;
      int t2 = (long long)(m - i) * po(m, 998244353 - 2) % 998244353 * (n - 2) %
               998244353 * po(n - 1, 998244353 - 2) % 998244353;
      int t3 = (long long)i * po(m, 998244353 - 2) % 998244353;
      t1 = ((long long)t1 * h[i + 1] % 998244353 + 1) % 998244353;
      int ti = (1 - t2 + 998244353) % 998244353;
      k[i] = (long long)t3 * po(ti, 998244353 - 2) % 998244353;
      b[i] = (long long)t1 * po(ti, 998244353 - 2) % 998244353;
    } else {
      int t1 = (long long)(m - i) * po(m, 998244353 - 2) % 998244353 *
               po(n - 1, 998244353 - 2) % 998244353;
      int t2 = (long long)(m - i) * po(m, 998244353 - 2) % 998244353 * (n - 2) %
               998244353 * po(n - 1, 998244353 - 2) % 998244353;
      int t3 = (long long)i * po(m, 998244353 - 2) % 998244353;
      int tmp = ((1 - t2 - (long long)t1 * k[i + 1] % 998244353) % 998244353 +
                 998244353) %
                998244353;
      tmp = po(tmp, 998244353 - 2);
      if (tmp == 0) {
        flag[i] = flag[i - 1] = 1;
        int ti1 = (1 + (long long)t1 * b[i + 1] % 998244353) % 998244353,
            ti3 = t3;
        h[i - 1] =
            (long long)(998244353 - ti1) * po(ti3, 998244353 - 2) % 998244353;
        i--;
      }
      b[i] = (long long)(1 + (long long)t1 * b[i + 1] % 998244353) * tmp %
             998244353;
      k[i] = (long long)t3 * tmp % 998244353;
    }
  }
  int tmp = (998244353 + 1 - k[1]) % 998244353;
  tmp = po(tmp, 998244353 - 2);
  flag[0] = flag[1] = 1;
  h[1] = (long long)((long long)k[1] * (n - 1) % 998244353 + b[1]) % 998244353 *
         tmp % 998244353;
  h[0] = (h[1] + n - 1) % 998244353;
  for (int i = 2; i < m; i++)
    h[i] = ((long long)k[i] * h[i - 1] % 998244353 + b[i]) % 998244353;
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = (ans + h[s[i]]) % 998244353;
  ans =
      ((ans - (long long)h[0] * (n - 1) % 998244353) % 998244353 + 998244353) %
      998244353;
  ans = (long long)ans * po(n, 998244353 - 2) % 998244353;
  printf("%d\n", ans);
  return 0;
}
