#include <bits/stdc++.h>

using namespace std;

long long stepen(long long c, unsigned long long i)
{
    long long x=1, d=998244353;
    for(unsigned long long j=1;j<=i;j++)
    {
        x*=c;
        x=x%998244353;
    }
    return x;
}

int main ()
{
    unsigned long long d=998244353;
    unsigned long long N, M;
    cin >> N >> M;
    vector<unsigned long long> B, A;
    A.push_back(0);
    B.push_back(0);
    for(unsigned long long i=1;i<=N;i++)
        A.push_back(i);
    for(unsigned long long i=1;i<=M;i++)
    {
        unsigned long long t;
        cin >> t;
        B.push_back(t);
    }
    for(unsigned long long i=0;i<=N-M;i++)
    {
        for(unsigned long long j=1;j<=M;j++)
            A[i+B[j]]=A[i+j];
    }
    long long c;
    cin >> c;
    c=c%998244353;
    long long r=0;
    for(unsigned long long i=1;i<=N;i++)
    {
        r=r+stepen(c,i)*A[i];
        r=r%998244353;
    }
    cout << r%d << endl;
    return 0;
}