#include <iostream>

using namespace std;
const int N=1e5+10;

int main()
{
    long long d=998244353,g=1,x=0,c;
    int i,j,n,m,a[N],b[N];
    cin >> n >> m;
    for (i=1;i<=n;i++)
        a[i]=i;
    for (i=1;i<=m;i++)
        cin >> b[i];
    cin >> c;
    for (i=0;i<=n-m;i++)
    {
        for (j=1;j<=m;j++)
            a[i+b[j]]=a[i+j];
    }
    for (i=1;i<=n;i++)
    {
        g=(g*c)%d;
        x=(x+(g*a[i])%d)%d;
    }
    cout << x;
    return 0;
}