#include<iostream>
#include<vector>

using namespace std;


/*
14 6
6 4 3 3 2 1
-1
*/
int main()
{
	

	int M, N,C;
	vector<int> B,A;
	cin >> N >> M;
	B.resize(M+100);
	for (int i = 0; i < M; i++)
		cin >> B[i];




	A.resize(N+100);
	for (int i = 0; i < N; i++)
		A[i] = i + 1;

	cin >> C;
	for (int i = 0; i <= N - M; i++)
	{
		for (int j = 0; j < M; j++)
		{
			A[i - 1 + B[j]] = A[i  + j];
		}
	
	}


	

	long long modC = 1;
	long long sum = 0;
	for (int i = 0; i < N; i++)
	{
		modC = (long long)((modC % 998244353)*C) % 998244353;
	
		sum += modC * A[i];
		
	}

	cout << sum << endl;



	return 0;
}