#include<iostream>

using namespace std;

long suma(int a[],int C,int n );

int main()
{
	int M, N,a[100],b[100];
	cin>> N >> M;
	for (int i = 1; i <= N; i++) a[i] = i;
	for (int j = 1; j <= M; j++)
	{
		cin >> b[j];
	}
	for (int i = 0; i <= N-M; i++)
		for (int j = 1; j <= M; j++)
		{
			a[b[j] + i] = a[j + i];
		}
	int C;
	cin >> C;
	cout << suma(a, C, N);
	return 0;
}

long suma(int a[], int C,int n)
{
	int sum = a[n];
	for (int i = n -1; i > 0; i--)
	{
		sum =( C*sum + a[i])% 998244353;
	}
	return sum*C;
}