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

namespace ConsoleApplication28
{
    class Program
    {
        static void Main(string[] args)
        {
            string ul = Console.ReadLine();
            int n = int.Parse(ul.Split()[0]);
            int m = int.Parse(ul.Split()[1]);
            int[] b = new int[m];
            string[] nizz = Console.ReadLine().Split();
            b = nizz.Select(int.Parse).ToArray();
            long c = Convert.ToInt64(Console.ReadLine());
            for (int i = 0; i < m; i++) ;
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = i + 1;
            }
            for (int i = 0; i <= n - m; i++)
            {
                for (int j = 1; j <= m; j++)
                { a[i + b[j-1] - 1] = a[i + j - 1]; }
            }
            long x = 0;
            for(int i=1;i<=n;i++)
            {
                x = x + Convert.ToInt64((Math.Pow(c, i) % 998244353) * (a[i - 1] % 998244353));
            }
            x = x % 998244353;
            Console.WriteLine(x);
        }
    }
}