#include <stdio.h>
#include <stdlib.h>
long long stepen(int a,int b){
int c=b;
long long d=1;
while(c!=0){
    d*=a;
    c--;
}
return d;
}
int main()
{
    long n,s=0;
    long m,c;

    scanf("%ld",&n);
    scanf("%ld",&m);
     long a[n+1];
    long b[m+1];
    for(long i=1;i<=m;i++){
        scanf("%ld",&b[i]);
    }
    for (long i=1;i<=n;i++){
        a[i]=i;
    }
    scanf("%ld",&c);
    for(long i=0;i<=n-m;i++)
        for (long j=1; j<=m; j++)
            a[i + b[j]] = a[i + j];
    for( long i=1;i<=n;i++){
        s+=stepen(c,i)*a[i];
        s=s%998244353;
    }
    printf("%ld",s);
    return 0;
}