cin >> n; ll sum = 0, inv, ans = 1; for (int i = 1; i <= n; ++i) cin >> P[i], sum += P[i]; inv = pow_mod(sum, p - 2); for (int i = 1; i <= n; ++i) P[i] = P[i] * pow_mod(sum, p - 2) % p; for (int i = 1; i <= n; ++i) ans = ans * pow_mod(1 - P[i], p - 2) % p; sum = 0; for (int i = 1; i <= n; ++i) sum = (sum + P[i] * pow_mod(1 - P[i], p - 2)) % p; ans = (ans + 2 * ans * sum) % p; cout << (ans + p) % p << "\n"; return0; }