Programmers working on a large project have just received a task to write exactly m lines of code. There are n programmers working on a project, the i-th of them makes exactly ai bugs in every line of code that he writes. 

Let's call a sequence of non-negative integers v1, v2, ..., vn a plan, if v1 + v2 + ... + vn = m. The programmers follow the plan like that: in the beginning the first programmer writes the first v1 lines of the given task, then the second programmer writes v2 more lines of the given task, and so on. In the end, the last programmer writes the remaining lines of the code. Let's call a plan good, if all the written lines of the task contain at most b bugs in total.

Your task is to determine how many distinct good plans are there. As the number of plans can be large, print the remainder of this number modulo given positive integer mod.

Input

The first line contains four integers n, m, b, mod (1 ≤ n, m ≤ 500, 0 ≤ b ≤ 500; 1 ≤ mod ≤ 109 + 7) — the number of programmers, the number of lines of code in the task, the maximum total number of bugs respectively and the modulo you should use when printing the answer.

The next line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 500) — the number of bugs per line for each programmer.

Output

Print a single integer — the answer to the problem modulo mod.

Examples

Input

3 3 3 100
1 1 1


Output

10


Input

3 6 5 1000000007
1 2 3


Output

0


Input

3 5 6 11
1 2 1


Output

0
import java.io.*;
import java.util.*;

public class A1302 {
    InputReader in;
    PrintWriter out;
    Utils utils;

    long ans[][], prev[][];
    long mod;
    int ar [];

    void solve() {
        int n = in.nextInt();
        int m = in.nextInt();
        int b = in.nextInt();
        mod = in.nextInt();
        ar = new int[n];
        for (int i = 0; i < n; i++) {
            ar[i] = in.nextInt();
        }

        ans = new long[m+1][b+1];
        prev = new long[m+1][b+1];

        set(ans,m,b,0);
        set(prev,m,b,0);

        for( int lines = 0 ; lines <=m; lines++) {
            for(int bugs = 0 ; bugs <=b; bugs++) {
                if(lines*ar[0] == bugs) {
                    prev[lines][bugs] = 1;
                    //System.out.println(0+" "+lines+" "+bugs+" "+prev[lines][bugs]);
                }
            }
        }

        for( int i = 1; i <n; i++) {
            for( int lines = 0; lines <=m; lines++) {
                for(int bugs = 0 ; bugs <=b; bugs++) {
                    ans[lines][bugs] = prev[lines][bugs];
                    if(lines >= 1 && bugs >=ar[i]) {
                        ans[lines][bugs] = (ans[lines][bugs] + ans[lines-1][bugs - ar[i]]) % mod;
                    }
                    //System.out.println(i+" "+lines+" "+bugs+" "+ans[lines][bugs]);
                }
            }
            copy(ans,prev,m,b);
            set(ans, m, b, 0);
        }



        long finalAns = 0;
        for( int bugs = b; bugs >=0; bugs--) {
            finalAns = ( finalAns + prev[m][bugs] )% mod;
        }
        out.println(finalAns);
    }

    public void copy(long[][] p, long [][] q, int m, int b) {
        for (int i = 0; i <=m; i++) {
            for (int j = 0; j <=b; j++) {
                q[i][j] =  p[i][j];
            }
        }
    }

    public void set( long [][] p, int m, int b, int val) {
        for (int i = 0; i <=m; i++) {
            for (int j = 0; j <=b; j++) {
                ans[i][j] =  val;
            }
        }
    }

    public static void main(String[] args) {
        new A1302().runIO();
    }

    public void runIO() {
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);
        utils = new Utils();
        solve();
        out.close();
    }
    public void run() {
        try {
            in = new InputReader(new File("test.in"));
            out = new PrintWriter(new File("test.out"));
            utils = new Utils();

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
    class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(File file) {
            try {
                reader = new BufferedReader(new FileReader(file));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
    class LongPair implements Comparable<LongPair>{
        long a,b;

        public LongPair(long a, long b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            LongPair longPair = (LongPair) o;

            if (a != longPair.a) return false;
            return b == longPair.b;
        }

        @Override
        public int hashCode() {
            int result = (int) (a ^ (a >>> 32));
            result = 31 * result + (int) (b ^ (b >>> 32));
            return result;
        }

        @Override
        public int compareTo(LongPair o) {
            LongPair longPair = (LongPair) o;
            if (a != longPair.a) {
                return Long.compare(a,longPair.a);
            }
            return Long.compare(b,longPair.b);
        }
    }
    class Utils {
        public  long gcd(long a, long b)
        {
            if(b==0)
                return a;
            else
                return gcd(b,a%b);
        }

        public long  modulo(long a, long b, long c){
            if(b==0L)
                return 1;
            if(b==1L)
                return a;
            long ans = modulo(a, b>>1L, c);
            ans = (ans*ans) % c;
            if(b%2L == 1L)
                ans=(ans*a) % c;
            return ans;
        }
    }
}