N,K = map(int,input().split()) A = list(map(int,input().split())) P = 998244353 ans = sum(A)*(1 + K * (K + 1)//2) % P print(ans)