#include <iostream>

using namespace std;

int main()
{
    int n, m, *b, *a, i, j, x, c, br=998244353;
    cin>>n>>m;
    b= new int[m+1];
    a= new int[n+1];
    x=n-m+1;
    for(i=1;i<=m;i++) cin>>b[i];
    for(i=1;i<=n;i++) a[i]=i;
    for(i=0;i<x;i++)
    {
        for (j=1; j<=m; j++)
        a[i + b[j]] = a[i + j];
    }
    cin>>c;
    x=0;
    for(i=n;i>0;i--)
    {
        x=(x+a[i])*c;
        if(x>=br)x%=br;
    }
    cout<<x;

    delete []a;
    delete []b;
    return 0;