#include <iostream>
#include <vector>

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