#include <iostream>
#include <cmath>

using namespace std;

int izracunaj(int broj, int stepen, int mod){
   if(stepen == 0)
      return 1;
   int z = izracunaj(broj, stepen/2, mod);
   if(stepen % 2 == 0)
      return (z*z) % mod; 
   else
      return (((z*broj) % mod) * z) % mod;
}

int main()
{
	int m, n;
	cin >> n;
	cin >> m;
	long resenje = 0;
	int* a = new int[n + 1];
	int* b = new int[m];
	for(int i = 0; i < m; i++)
		cin >> b[i];
	for(int i = 0; i <= n; i++)
		a[i] = i;
	for(int i = 0; i <= n-m; i++)
		for (int j=1; j<=m; j++)
			a[i + b[j-1]] = a[i + j];
	int c;
	cin >> c;
	for(int i = 1; i <= n; i++)
	{
		//float p = c * pow((float)a[i], 1/i);
		//resenje += (int)ceil(fmodf(p, pow(998244353.0, 1/i)));
		//int z = (int)pow((double)(c%m), i) % 998244353;
		int z = izracunaj(c, i, 998244353);
		resenje += (z * (a[i] % 998244353)) % 998244353;
	}
	cout << resenje;
	return 0;
}