mod = 998244353 N = 2*10**5 inverse = [1]*(N+1) for i in range( 2, N + 1 ): inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod ) inverse[0]=0 N,M = map(int,input().split()) A = [0] + list(map(int,input().split())) res = 0 for j in range(M): for i in range(A[j],A[j+1]): res += A[j+1] * inverse[N-i] res %= mod print(res)