#include <iostream>
#include <vector>

//#define FEEDBACK

using namespace std;

int pow(int a, int b){
    int res = 1;
    for(int i = 0; i < b; ++i){
        res *= a;
    }
    return res;
}

int main(int argc, const char * argv[]) {
    int n, m, res;
    vector<int> a;
    vector<int> b;
    int ulaz;
    cin >> n >> m;
    for(int i = 1; i <= n; ++i){
        a.push_back(i);
    }
    for(int i = 0; i < m; ++i){
        cin >> ulaz;
        b.push_back(ulaz);
    }
    int c;
    cin >> c;
    for(int i = 0; i <= n-m; ++i){
        for(int j = 0; j < m; ++j){
            a[i + b[j]-1] = a[i + j];
        }
    }
#ifdef FEEDBACK
    for(int i = 0; i < n; ++i){
        cout << a[i] << " ";
    }
    cout << endl;
#endif
    res = 0;
    for(int i = 1; i <= n; ++i){
#ifdef FEEDBACK
        cout << (pow(c, i)*a[i-1])%998244353 << endl;
#endif
        res += (pow(c, i)*a[i-1])%998244353;
    }
    cout << res << endl;
    return 0;
}