//#include "pch.h"
#include <iostream>
int b[100000], a[20000000];
int main()
{
	long long n, m, c;
	long long x=0, pc;
	std::cin >> n >> m;
	for (int i = 0; i < m; i++)
		std::cin >> b[i];
	std::cin >> c;
	for (int i = 0; i <= n; i++)
		a[i] = i;
	for (int i = 0; i <= n - m; i++)
		for (int j = 0; j < m; j++)
			a[i + b[j]] = a[i +1+ j];
	for (int i = 1; i <= n; i++)
	{
		pc = c;
		for (int k = 0; k < i-1; k++)
			pc *= c;
		x += pc * a[i];
		if (x >= 998244353)
			x -= 998244353;
	}
	std::cout << x;
	//return main();
}