#include <bits/stdc++.h>
#define NMAX 500000
#define MMAX 100000
#define MODULO 998244353
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
#define forn(a,b,c) for(int a=b;a<c;a++)
#define ford(a,b,c) for(int a=b;a>=c;a--)
int a[NMAX], b[MMAX];
int n,m,c;
ll stepen(int x,int s)
{
    ll ans = 1;
    while(s--)
        ans = (ans * (ll)x) % MODULO;
    return ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
        a[i] = i;
    for(int i = 1; i <= m; i++)
        cin >> b[i];
    cin >> c;
    for(int i = 0; i <= (n - m); i++)
    {
        for(int j = 1; j <= m; j++)
            a[i + b[j]] = a[i + j];
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++)
        ans += (stepen(c,i) * (ll)a[i]) % MODULO;
    cout << ans;
    return 0;
}