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)
        {
            string a = Convert.ToString(Console.ReadLine());
            string[] a1 = a.Split(' ');
            int n = Convert.ToInt32(a1[0]);
            int m = Convert.ToInt32(a1[1]);
            a = Convert.ToString(Console.ReadLine());
            string[] a2 = a.Split(' ');
            int[] b = new int[m];
            for(int i = 0; i < m; i++)
            {
                b[i] = Convert.ToInt32(a2[i]);
            }
            a = Convert.ToString(Console.ReadLine());
            int c = Convert.ToInt32(a);
            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 = 0; j < m; j++)
                {
                    A[i + b[j] - 1] = A[i + j];
                }
            }
            double x = 0;
            for(int i = 0; i < n; i++)
            {
                x += Math.Pow(c, i + 1) * A[i];
            }
            x = x % 998244353;
            Console.WriteLine("{0}", x);
            Console.ReadLine();
        }
    }
}