There are N bags of biscuits. The i-th bag contains A_i biscuits.

Takaki will select some of these bags and eat all of the biscuits inside. Here, it is also possible to select all or none of the bags.

He would like to select bags so that the total number of biscuits inside is congruent to P modulo 2. How many such ways to select bags there are?

Constraints

* 1 \leq N \leq 50
* P = 0 or 1
* 1 \leq A_i \leq 100

Input

Input is given from Standard Input in the following format:


N P
A_1 A_2 ... A_N


Output

Print the number of ways to select bags so that the total number of biscuits inside is congruent to P modulo 2.

Examples

Input

2 0
1 3


Output

2


Input

1 1
50


Output

0


Input

3 0
1 1 1


Output

4


Input

45 1
17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26


Output

17592186044416
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007L;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static ArrayList<int[]> list = new ArrayList<>();
	public static void main(String[] args) throws Exception {


		int N = nextInt();
		int P = nextInt();
		int[] A = nextInts();
		long odd = 0;
		long even = 0;
		for(int i=0;i<N;i++){
			if(A[i]%2==0){
				even++;
			}else{
				odd++;
			}
		}
		long ans = 0;
		if(P==0){
			for(int i=0;i<=odd;i+=2){
				long p=1;
				long d=1;
				for(int k=1;k<=i;k++){
					p*=odd-k+1;
					d*=k;
					long x;
					while((x=gcd(p,d))!=1){
						p/=x;
						d/=x;
					}
				}
				ans+=(long)Math.pow(2, even)*(p/d);
			}
		}else{
			for(int i=1;i<=odd;i+=2){
				long p=1;
				long d=1;
				for(int k=1;k<=i;k++){
					p*=odd-k+1;
					d*=k;
					if(k%2==0){
						p/=2;
						d/=2;
						long x;
						while((x=gcd(p,d))!=1){
							p/=x;
							d/=x;
						}
					}
				}

				ans+=(long)Math.pow(2, even)*(p/d);
			}
		}
		System.out.println(ans);
	}


public static long gcd(long a, long b) {
	long x, y;
	if (a < b) {
		x = b;
		y = a;
	} else {
		x = a;
		y = b;
	}
	long r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static String concatStringArray(String[] s){
		StringBuffer sb = new StringBuffer();
		for(String x:s){
			sb.append(x);
		}
		return sb.toString();
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}
