N,P=list(map(int, input().split()))

*A,=list(map(int, input().split()))



even=sum(1 for a in A if a&1==0)

odd =sum(1 for a in A if a&1==1)



def comb(n, r):

    p, q = 1, 1

    for i in range(min(r,n-r)):

        p *= n-i

        q *= i+1

    return p // q



ans=0

for i in range(P,odd+1,2):

    ans+=comb(odd, i)

ans *= 1<<even



print(ans)
N,P=list(map(int, input().split()))

*A,=list(map(int, input().split()))

odd=sum(1 for a in A if a&1)

if odd==0:

    if P==1:

        print((0))

    else:

        print((1<<N))

else:

    print((1<<(N-1)))
N, P = list(map(int, input().split()))
(*A,) = list(map(int, input().split()))
even = sum(1 for a in A if a & 1 == 0)
odd = sum(1 for a in A if a & 1 == 1)


def comb(n, r):
    p, q = 1, 1
    for i in range(min(r, n - r)):
        p *= n - i
        q *= i + 1
    return p // q


ans = 0
for i in range(P, odd + 1, 2):
    ans += comb(odd, i)
ans *= 1 << even
print(ans)

N, P = list(map(int, input().split()))
(*A,) = list(map(int, input().split()))
odd = sum(1 for a in A if a & 1)
if odd == 0:
    if P == 1:
        print((0))
    else:
        print((1 << N))
else:
    print((1 << (N - 1)))

-even = sum(1 for a in A if a & 1 == 0) -odd = sum(1 for a in A if a & 1 == 1) - - -def comb(n, r): -    p, q = 1, 1 -    for i in range(min(r, n - r)): -        p *= n - i -        q *= i + 1 -    return p // q - - -ans = 0 -for i in range(P, odd + 1, 2): -    ans += comb(odd, i) -ans *= 1 << even -print(ans) +odd = sum(1 for a in A if a & 1) +if odd == 0: +    if P == 1: +        print((0)) +    else: +        print((1 << N)) +else: +    print((1 << (N - 1)))