#include <bits/stdc++.h>

using namespace std;

#define INFI 987654321
#define INFL 987654321987654321
#define MOD 998244353

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template<typename T>
void read(T, long long);

template<typename T>
void write(T, long long);

template<typename T>
long long sumFor(T, long long, long long);

template<typename T>
long long sumFor(T, long long);

long long power(long long, long long, long long);
long long power(long long, long long);
void add(long long&, long long&);
long long getRand();
long long max(long long, long long, long long);

/// //MAIN// ///

long long a[20000005];
long long b[100000];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    long long n, m;
    cin >> n >> m;
    for(long long i = 1; i <= m; ++i){
        cin >> b[i];
    }

    long long c;
    cin >> c;

    for(long long i = 1; i <= n; ++i){
        a[i] = i;
    }

    for(long long i = 0; i <= n - m; ++i){
        for(long long j = 1; j <= m; ++j){
            a[i + b[j]] = a[i + j];
        }
    }

    long long sum = 0;
    long long pc = 1;

    for(long long i = 1; i <= n; ++i){
        sum = (sum + (((pc * c) % MOD) * a[i]) % MOD) % MOD;
        pc = (pc * c) % MOD;
    }

    cout << sum % MOD << "\n";
    return 0;
}

/// /////////////////////////////////////////////

long long max(long long m_a, long long m_b, long long m_c){
    if(m_c >= m_a && m_c >= m_b){
        return m_c;
    }
    return m_a >= m_b ? m_a : m_b;
}

long long getRand(){
    return rng();
}

void add(long long& m_a, long long& m_b){
    m_a = (m_a + m_b) % MOD;
}

template<typename T>
void write(T m_pnter, long long m_size){
    for(long long i = 0; i < m_size; ++i){
        cout << m_pnter[i] << " ";
    }
    cout << "\n";
}

template<typename T>
void read(T m_pnter, long long m_size){
    for(long long i = 0; i < m_size; ++i){
        cin >> m_pnter[i];
    }
}

template<typename T>
long long sumFor(T m_pnter, long long m_l, long long m_r){
    long long m_sum = 0;
    for(long long i = m_l; i < m_r; ++i){
        m_sum += m_pnter[i];
    }
    return m_sum;
}

template<typename T>
long long sumFor(T m_pnter, long long m_r){
    long long m_sum = 0;
    for(long long i = 0; i < m_r; ++i){
        m_sum += m_pnter[i];
    }
    return m_sum;
}

long long power(long long m_a, long long m_b, long long m_mod){
    long long m_res = 1;
    while(m_b > 0){
        if(m_b % 2 == 1){
            m_res = (m_res * m_a) % m_mod;
        }
        m_b /= 2;
        m_a = (m_a * m_a) % m_mod;
    }
    return m_res;
}

long long power(long long m_a, long long m_b){
    long long m_res = 1;
    while(m_b > 0){
        if(m_b % 2 == 1){
            m_res = m_res * m_a;
        }
        m_b /= 2;
        m_a = m_a * m_a;
    }
    return m_res;
}