#include using namespace std; const long long mod = 998244353; vector fac, invfac; long long powmod(long long a, long long p) { long long res = 1,mul = a; for (; p > 0; p >>= 1, mul = (mul * mul) % mod) { if ((p & 1) == 1) res = (res * mul) % mod; } return res; } long long inv(long long a) { return powmod(a, mod - 2); } void set_factorial(int n) { fac.assign(n + 1, 1); invfac.resize(n + 1); for (int i = 1; i <= n; i++) { fac[i] = fac[i - 1] * i % mod; } invfac[n] = powmod(fac[n], mod - 2); for (int i = n - 1; i >= 0; i--) { invfac[i] = invfac[i + 1] * (i + 1) % mod; } } long long C(int n, int k) { if (n < k || n < 0 || k < 0) return 0; return fac[n] * invfac[k] % mod * invfac[n - k] % mod; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; map mp; for (int i = 0; i < n; i++) { long long a; cin >> a; mp[a]++; } long long ans = 0; for (auto [x, cnt]: mp) { long long iv = 2ll * inv(powmod(x*2, cnt)) % mod; for (auto [y, c]: mp) { if (x == y) continue; iv *= inv(powmod(( - x * x + y * y) % mod, c)); iv %= mod; } ans += iv; ans %= mod; } ans += mod; ans %= mod; cout << ans << "\n"; }