#include <iostream>
#include <vector>

using namespace std;

int main()
{
    long long MODCONST = 998244353;
    long long N, M, C;
    cin >> N;
    cin >> M;
    vector<long long> B(M + 1);
    vector<long long> A(N + 1);
    for (int i = 1; i < M + 1; i++)
        cin >> B[i];
    cin >> C;
    for (int i = 1; i < N + 1; i++)
        A[i] = i;

    for (int i = 0; i <= N - M; i++)
        for (int j = 1; j <= M; j++)
            A[i + B[j]] = A[i + j];
/*
    for (int i = 1; i < N + 1; i++)
        cout << A[i] << " ";*/

    long long X = 0;
    for (int i = N; i >= 1; i--)
    {
        X = (X % MODCONST) + (A[i] % MODCONST);
        X = (X % MODCONST) * (C % MODCONST);
    }

    X = X % MODCONST;
    cout << X;

    return 0;
}