MOD = 998244353 n = int(input()) a = list(map(int, input().split())) p = sum(a) print(p * pow(n, -1, MOD) % MOD)