#include <bits/stdc++.h> 
#define f first
#define s second
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

ll b[10000], A[10000];
ll mod = 998244353;

int main()
{
	ios::sync_with_stdio(false);	
	cin.tie(0);
	ll n, m;
	cin >> n >> m;		
	for(ll i = 1; i <= m; i++) cin >> b[i];
	for(ll i = 1; i <= n; i++) A[i] = i;
	
	ll c;	
	cin >> c;
	
	for(ll i = 0; i <= n-m; i++)
	{
		for(ll j = 1; j <= m; j++)
		{
			A[i+b[j]] = A[i + j];
		}
	}
	ll ci = c, s = ((c%mod)*(A[1]%mod))%mod;
	for(ll i = 2; i <= n; i++)
	{
		ci = (ci * c) % mod;
		s =  (s+(ci*(A[i]%mod)))%mod;
	}
	cout << s;
	return 0; 
}