n, p = list(map(int, input().split()))

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

U = n*100

dp = [0]*(U+1)

dp[0] = 1

for a in A:

    for j in reversed(list(range(U+1))):

        if 0 <= j-a:

            dp[j] += dp[j-a]

print((sum(dp[p::2])))

n, p = list(map(int, input().split()))

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

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

    if p:

        print((0))

    else:

        print((pow(2, n)))

else:

    print((pow(2, n-1)))

n, p = list(map(int, input().split()))
A = list(map(int, input().split()))
U = n * 100
dp = [0] * (U + 1)
dp[0] = 1
for a in A:
    for j in reversed(list(range(U + 1))):
        if 0 <= j - a:
            dp[j] += dp[j - a]
print((sum(dp[p::2])))

n, p = list(map(int, input().split()))
A = list(map(int, input().split()))
if all(a % 2 == 0 for a in A):
    if p:
        print((0))
    else:
        print((pow(2, n)))
else:
    print((pow(2, n - 1)))

-U = n * 100 -dp = [0] * (U + 1) -dp[0] = 1 -for a in A: -    for j in reversed(list(range(U + 1))): -        if 0 <= j - a: -            dp[j] += dp[j - a] -print((sum(dp[p::2]))) +if all(a % 2 == 0 for a in A): +    if p: +        print((0)) +    else: +        print((pow(2, n))) +else: +    print((pow(2, n - 1)))