#include <iostream>
#include <vector>
using namespace std;

int n, m;
vector<int> B;

int rek(int x, int granicaN, int granicaM) {
	if (n == 0) {
		return x;
	}
	
	// x = i + Bj
	
	for (int i = granicaN; i >= 0; i--) {
		int prvij = (i == granicaN) ? (granicaM - 1) : m;
		
		for (int j = prvij; j >= 1; j--) {
			
			if (x == i + B[j]) {
				return rek(i + j, i, j);
			}
		}
	}
	
	return x;
		
}

int main() {	
	cin >> n >> m;
	
	B.resize(m + 1);
	
	for (int i = 1; i <= m; i++) cin >> B[i];
	
	int c, tc, tcai, res = 0;
	
	cin >> c;
	
	tc = 1;
	
	const int MOD = 998244353;
	
	for (int i = 1; i <= n; i++) {
		int Ai = rek(i, n - m, m);
		
		tc = (tc % MOD * c % MOD) % MOD;
		
		tcai = (tc % MOD * Ai % MOD) % MOD;
		
		res = (res % MOD + tcai % MOD) % MOD;
		
	}
	
	cout << res << endl;
	
	return 0;
}