#include <bits/stdc++.h>
#define MODUL 998244353
using namespace std;

long long A[20000100], B[100100];
long long N, M, C;

int main(){
	cin >> N >> M;
	for (long long i=1; i<=N; i++) A[i]=i;
	for (long long j=1; j<=M; j++) cin >> B[j];
	
	cin >> C;
	
	for (long long i=0; i<=N-M; i++){
		for (int j=1; j<=M; j++)
   			A[i + B[j]] = A[i + j];
	}
	
	long long X=0, P=1;
	for (long long i=1; i<=N; i++){
		P*=C;
		X+=P*A[i];
	}
	
	cout << X%MODUL << endl;
	return 0;
}