#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
long long MOD = 998244353;
long long power_mod(long long v, long long p, long long m) {
  if (p == 0) return 1;
  long long res = power_mod((v * v) % m, p / 2, m);
  if (p & 1) res = (res * v) % m;
  return res;
}
long long inverse_mod(long long v, long long m) {
  return power_mod(v, m - 2, m);
}
struct ModInt {
  long long n, d;
  ModInt(long long n_ = 0, long long d_ = 1) : n(n_), d(d_){};
  ModInt &operator+=(const ModInt &f) {
    long long nn = (n * f.d + d * f.n) % MOD;
    d = (d * f.d) % MOD;
    n = nn;
    return *this;
  }
  ModInt &operator-=(const ModInt &f) {
    long long nn = (n * f.d - d * f.n) % MOD;
    d = (d * f.d) % MOD;
    n = (nn < 0) ? nn + MOD : nn;
    return *this;
  }
  ModInt &operator*=(const ModInt &f) {
    n = (n * f.n) % MOD;
    d = (d * f.d) % MOD;
    return *this;
  }
  ModInt &operator/=(const ModInt &f) {
    n = (n * f.d) % MOD;
    d = (d * f.n) % MOD;
    return *this;
  }
  ModInt operator-() const { return (n == 0) ? ModInt(0) : ModInt(MOD - n, d); }
  ModInt operator+(const ModInt &f) const {
    long long nn = (n * f.d + d * f.n) % MOD;
    long long dd = (d * f.d) % MOD;
    return ModInt(nn, dd);
  }
  ModInt operator-(const ModInt &f) const { return *this + (-f); }
  ModInt operator*(const ModInt &f) const {
    return ModInt((n * f.n) % MOD, (d * f.d) % MOD);
  }
  ModInt operator/(const ModInt &f) const {
    return ModInt((n * f.d) % MOD, (d * f.n) % MOD);
  }
  bool operator==(const ModInt &f) const {
    return (n * f.d - d * f.n) % MOD == 0;
  }
};
ostream &operator<<(ostream &str, const ModInt &f) {
  return str << ((f.n * inverse_mod(f.d, MOD)) % MOD);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int i = (0); i < (N); i++) cin >> a[i];
  int S = 0;
  for (auto i : a) S += (int)i;
  vector<ModInt> add(S), mul(S);
  ModInt invS = ModInt(1) / ModInt(S);
  ModInt invNm1 = ModInt(1) / ModInt(N - 1);
  for (int i = (0); i < (S); i++) {
    ModInt help = ModInt(S - i) * invS;
    ModInt ad = 1, fm1 = ModInt(i) * invS, fsame = help * (ModInt(1) - invNm1),
           fp1 = help * invNm1;
    if (fm1.n) {
      ad += fm1 * add[i - 1];
      fsame += fm1 * mul[i - 1];
    }
    ModInt scale = ModInt(1) / (ModInt(1) - fsame);
    add[i] = ad * scale;
    mul[i] = fp1 * scale;
  }
  vector<ModInt> return_time(S + 1);
  return_time[S] = 0;
  for (int i = int(S) - 1; i >= (0); i--) {
    return_time[i] = add[i] + mul[i] * return_time[i + 1];
  }
  ModInt res(0);
  for (auto i : a) res += return_time[i];
  res -= return_time[0] * ModInt(N - 1);
  res /= ModInt(N);
  cout << res << endl;
  return 0;
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

Slime and his n friends are at a party. Slime has designed a game for his friends to play.

At the beginning of the game, the i-th player has a_i biscuits. At each second, Slime will choose a biscuit randomly uniformly among all a_1 + a_2 + … + a_n biscuits, and the owner of this biscuit will give it to a random uniform player among n-1 players except himself. The game stops when one person will have all the biscuits.

As the host of the party, Slime wants to know the expected value of the time that the game will last, to hold the next activity on time.

For convenience, as the answer can be represented as a rational number p/q for coprime p and q, you need to find the value of (p ⋅ q^{-1})mod 998 244 353. You can prove that qmod 998 244 353 ≠ 0.

Input

The first line contains one integer n\ (2≤ n≤ 100 000): the number of people playing the game.

The second line contains n non-negative integers a_1,a_2,...,a_n\ (1≤ a_1+a_2+...+a_n≤ 300 000), where a_i represents the number of biscuits the i-th person own at the beginning.

Output

Print one integer: the expected value of the time that the game will last, modulo 998 244 353.

Examples

Input


2
1 1


Output


1


Input


2
1 2


Output


3


Input


5
0 0 0 0 35


Output


0


Input


5
8 4 2 0 1


Output


801604029

Note

For the first example, in the first second, the probability that player 1 will give the player 2 a biscuit is 1/2, and the probability that player 2 will give the player 1 a biscuit is 1/2. But anyway, the game will stop after exactly 1 second because only one player will occupy all biscuits after 1 second, so the answer is 1.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
long long MOD = 998244353;
long long power_mod(long long v, long long p, long long m) {
  if (p == 0) return 1;
  long long res = power_mod((v * v) % m, p / 2, m);
  if (p & 1) res = (res * v) % m;
  return res;
}
long long inverse_mod(long long v, long long m) {
  return power_mod(v, m - 2, m);
}
struct ModInt {
  long long n, d;
  ModInt(long long n_ = 0, long long d_ = 1) : n(n_), d(d_){};
  ModInt &operator+=(const ModInt &f) {
    long long nn = (n * f.d + d * f.n) % MOD;
    d = (d * f.d) % MOD;
    n = nn;
    return *this;
  }
  ModInt &operator-=(const ModInt &f) {
    long long nn = (n * f.d - d * f.n) % MOD;
    d = (d * f.d) % MOD;
    n = (nn < 0) ? nn + MOD : nn;
    return *this;
  }
  ModInt &operator*=(const ModInt &f) {
    n = (n * f.n) % MOD;
    d = (d * f.d) % MOD;
    return *this;
  }
  ModInt &operator/=(const ModInt &f) {
    n = (n * f.d) % MOD;
    d = (d * f.n) % MOD;
    return *this;
  }
  ModInt operator-() const { return (n == 0) ? ModInt(0) : ModInt(MOD - n, d); }
  ModInt operator+(const ModInt &f) const {
    long long nn = (n * f.d + d * f.n) % MOD;
    long long dd = (d * f.d) % MOD;
    return ModInt(nn, dd);
  }
  ModInt operator-(const ModInt &f) const { return *this + (-f); }
  ModInt operator*(const ModInt &f) const {
    return ModInt((n * f.n) % MOD, (d * f.d) % MOD);
  }
  ModInt operator/(const ModInt &f) const {
    return ModInt((n * f.d) % MOD, (d * f.n) % MOD);
  }
  bool operator==(const ModInt &f) const {
    return (n * f.d - d * f.n) % MOD == 0;
  }
};
ostream &operator<<(ostream &str, const ModInt &f) {
  return str << ((f.n * inverse_mod(f.d, MOD)) % MOD);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int i = (0); i < (N); i++) cin >> a[i];
  int S = 0;
  for (auto i : a) S += (int)i;
  vector<ModInt> add(S), mul(S);
  ModInt invS = ModInt(1) / ModInt(S);
  ModInt invNm1 = ModInt(1) / ModInt(N - 1);
  for (int i = (0); i < (S); i++) {
    ModInt help = ModInt(S - i) * invS;
    ModInt ad = 1, fm1 = ModInt(i) * invS, fsame = help * (ModInt(1) - invNm1),
           fp1 = help * invNm1;
    if (fm1.n) {
      ad += fm1 * add[i - 1];
      fsame += fm1 * mul[i - 1];
    }
    ModInt scale = ModInt(1) / (ModInt(1) - fsame);
    add[i] = ad * scale;
    mul[i] = fp1 * scale;
  }
  vector<ModInt> return_time(S + 1);
  return_time[S] = 0;
  for (int i = int(S) - 1; i >= (0); i--) {
    return_time[i] = add[i] + mul[i] * return_time[i + 1];
  }
  ModInt res(0);
  for (auto i : a) res += return_time[i];
  res -= return_time[0] * ModInt(N - 1);
  res /= ModInt(N);
  cout << res << endl;
  return 0;
}

```