using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Vrednost_Dodele
{
    class Program
    {
        static void Main(string[] args)
        {
            long M, N;
            long C,X=0;
            long c = 1;
            string[] ul;
            ul = Console.ReadLine().Split(' ');
            N = Convert.ToInt64(ul[0]);
            M = Convert.ToInt64(ul[1]);
            long[] B = new long[M + 1];
            ul = Console.ReadLine().Split(' ');
            for(long i=1;i<=M;i++)
            {
                B[i] = Convert.ToInt64(ul[i-1]);
            }
            long[] A = new long[N+1];
            for(long i=1;i<=N;i++)
            {
                A[i] = i;
            }
            for(long i=0;i<=N-M;i++)
            {
                for (long j = 1; j <= M; j++)
                {
                    A[i + B[j]] = A[i + j];
                }
            }
            C = Convert.ToInt64(Console.ReadLine());
            for(long i=1;i<=N;i++)
            {
                c *= C;
                X += (c* A[i]);
                
            }
            X = X % 998244353;
            Console.WriteLine(X);
     

        }
    }
}