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

bs = list(map(int, input().split()))

even = 0

for i in range(N):

    if bs[i]%2 == 0: even += 1

odd = N-even



f = [1]

for n in range(1, N+2):

    f.append(f[-1] * n)



def ncr(n,r):

    return f[n] // f[n-r] // f[r]



oddc = 0

for i in range(odd+1):

    if i%2 != P : continue

    oddc += ncr(odd,i)



print((pow(2,even) * oddc))

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

src = list(map(int,input().split()))



if all(a%2==0 for a in src):

    if P:

        print((0))

    else:

        print((2**N))

    exit()

print((2**(N-1)))
N, P = list(map(int, input().split()))
bs = list(map(int, input().split()))
even = 0
for i in range(N):
    if bs[i] % 2 == 0:
        even += 1
odd = N - even
f = [1]
for n in range(1, N + 2):
    f.append(f[-1] * n)


def ncr(n, r):
    return f[n] // f[n - r] // f[r]


oddc = 0
for i in range(odd + 1):
    if i % 2 != P:
        continue
    oddc += ncr(odd, i)
print((pow(2, even) * oddc))

N, P = list(map(int, input().split()))
src = list(map(int, input().split()))
if all(a % 2 == 0 for a in src):
    if P:
        print((0))
    else:
        print((2**N))
    exit()
print((2 ** (N - 1)))

-bs = list(map(int, input().split())) -even = 0 -for i in range(N): -    if bs[i] % 2 == 0: -        even += 1 -odd = N - even -f = [1] -for n in range(1, N + 2): -    f.append(f[-1] * n) - - -def ncr(n, r): -    return f[n] // f[n - r] // f[r] - - -oddc = 0 -for i in range(odd + 1): -    if i % 2 != P: -        continue -    oddc += ncr(odd, i) -print((pow(2, even) * oddc)) +src = list(map(int, input().split())) +if all(a % 2 == 0 for a in src): +    if P: +        print((0)) +    else: +        print((2**N)) +    exit() +print((2 ** (N - 1)))