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