qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    
    ans = 0
    ansans = 0
    for i in range(1, N+1):
        tmp = 0
        han = i
        aaa = i
        while True:
            if han % 2 == 0:
                han = han / 2
                tmp += 1
            else:
                break
        if tmp > ans:
            ans = tmp
            ansans = aaa
            
    print(ansans)
    
if __name__ == "__main__":
	main()


# Fixed code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    
    if N == 1:
        print(1)
        sys.exit()
    
    ans = 0
    ansans = 0
    for i in range(1, N+1):
        tmp = 0
        han = i
        aaa = i
        while True:
            if han % 2 == 0:
                han = han / 2
                tmp += 1
            else:
                break
        if tmp > ans:
            ans = tmp
            ansans = aaa
            
    print(ansans)
    
if __name__ == "__main__":
	main()
# Buggy code:
n=int(input())
elif n<2**1:
  print(1)
elif n<2**2:
  print(2)
elif n<2**3:
  print(4)
elif n<2**4:
  print(8)
elif n<2**5:
  print(16)
elif n<2**6:
  print(32)
elif n<2**7:
  print(64)
  

# Fixed code:
n=int(input())
if n<2**1:
  print(1)
elif n<2**2:
  print(2)
elif n<2**3:
  print(4)
elif n<2**4:
  print(8)
elif n<2**5:
  print(16)
elif n<2**6:
  print(32)
elif n<2**7:
  print(64)
# Buggy code:
n = int(input())
ans = 0
tmp = 0
for i in range(1, n + 1):
    cnt = 0
    x = i
    while x % 2 == 0:
        x //= 2
        cnt += 1
    if cnt > tmp:
        tmp = cnt
        ans = i
print(ans)

# Fixed code:
n = int(input())

max_cnt = 0
ans = 0
for i in range(1, n+1):
    cnt = 0
    x = i
    while x % 2 == 0:
        x //= 2
        cnt += 1
    if cnt >=  max_cnt:
        max_cnt = cnt
        ans = i

print(ans)
# Buggy code:
n = int(input())
ans = 0
for i in range(1, n):
  cnt = 0
  x = i
  while x % 2 == 0:
    x //= 2
    cnt += 1
  ans = max(ans, cnt)
print(ans)

# Fixed code:
n = int(input())
ans = 0
for i in range(1, n+1):
  cnt = 0
  x = i
  while x % 2 == 0:
    x //= 2
    cnt += 1
  ans = max(ans, cnt)
print(2 ** ans)
# Buggy code:
N = int(intput())
if N == 1:
  print(1)
  exit()
X = [2, 4, 8, 16, 32, 64, 128]
for i, x in enumerate(X):
  if N < x:
    print(X[i - 1])


# Fixed code:
N = int(input())
if N == 1:
    print(1)
    exit()
X = [2, 4, 8, 16, 32, 64, 128]
for i, x in enumerate(X):
    if N < x:
        print(X[i - 1])
        exit()
# Buggy code:
from math import log2;print(int(log2(int(input())))**2)

# Fixed code:
from math import log2;print(2**int(log2(int(input()))))
# Buggy code:
N = int(input())
for i in range(7):
  if 2**i < N and 2**i > N:
    print(2**i)
    break


# Fixed code:
N = int(input())
for i in range(7):
  if 2**i <= N and 2**(i+1) > N:
    print(2**i)
    break
# Buggy code:
N = int(input())
n = 1
while n < N:
    n *= 2

print(n // 2)

# Fixed code:
N = int(input())
n = 1
while n <= N:
  n *= 2
     
print(n // 2)
# Buggy code:
n = int(input())
x = [i for i in range(1,n+1)]
res = []
judge = 0

while len(x)>1:
  for j in x:
    if j%2==0:
      res.append(j/2)
  else:
    x = res
    res = []
    judge += 1

print(x[0]*(2**judge))
    

# Fixed code:
import math
n = int(input())
x = [i for i in range(1,n+1)]
res = []
judge = 0

while len(x)>1:
  for j in x:
    if j%2==0:
      res.append(j/2)
  else:
    x = res
    res = []
    judge += 1

print(math.floor(x[0]*(2**judge)))
# Buggy code:
n = int(input())
n = n + 1

import copy

ans = 0
ans_c = 0

for i in reversed(range(n)):
    check = copy.copy(i)
    div = 0
    count = 0

    while div == 0:
        div = (i % 2)
        i = i // 2
        if div == 0:
            count += 1
        if i == 0:
            break
    if ans_c < count:
        ans = check
        ans_c = count
        
print(ans)

# Fixed code:
n = int(input())
n += 1

import copy

ans = 0
ans_c = 0

for i in reversed(range(n)):
    check = copy.copy(i)
    div = 0
    count = 0

    while div == 0:
        div = (i % 2)
        i = i // 2
        if div == 0:
            count += 1
        if i == 0:
            break
    if ans_c < count:
        ans = check
        ans_c = count
if ans == 0:
     ans += 1
        
print(ans)
# Buggy code:
import logging
logging.basicConfig(level=logging.CRITICAL,format=' %(asctime)s - %(levelname)s - %(message)s')

def power(n):
    i = 1
    logging.info('func start')
    while n > 0:
        i *= 2
        n -= 1
        logging.debug('i = {}, n = {}'.format(i,n))
    logging.info('func end')
    return i

i = 0
n = int(input())
logging.info('in loop')
while power(i+1) < n:
    i = i + 1
    logging.debug('i = {}, pow(i) = {}'.format(i,power(i)))

logging.info('out loop')
print(power(i ))


# Fixed code:
import logging
logging.basicConfig(level=logging.CRITICAL,format=' %(asctime)s - %(levelname)s - %(message)s')

def power(n):
    i = 1
    logging.info('func start')
    while n > 0:
        i *= 2
        n -= 1
        logging.debug('i = {}, n = {}'.format(i,n))
    logging.info('func end')
    return i

i = 0
n = int(input())
logging.info('in loop')
while not (power(i + 1) > n):
    i = i + 1
    logging.debug('i = {}, pow(i) = {}'.format(i,power(i)))

logging.info('out loop')
print(power(i ))
# Buggy code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
n = raw_input()
if n >= 64:
  a = 64
elif n >= 32:
  a = 32
elif n >= 16:
  a = 16
elif n >= 8:
  a= 8
elif n >= 4:
  a = 4
elif n >= 2:
  a = 2
else:
  a = 1
print(a)

# Fixed code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
n = int(input())
if n >= 64:
  a = 64
elif n >= 32:
  a = 32
elif n >= 16:
  a = 16
elif n >= 8:
  a= 8
elif n >= 4:
  a = 4
elif n >= 2:
  a = 2
else:
  a = 1
print(a)
# Buggy code:
N = int(input())

nList = [i + 1 for i in range(N)]
res = -1
for n in nList :
    count = 0
    buf = n
    while buf % 2 == 0 :
        count += 1
        buf = buf / 2
    if res < count :
        res = n
print(res)


# Fixed code:
N = int(input())

nList = [i + 1 for i in range(N)]
res = -1
counter = -1
for n in nList :
    count = 0
    buf = n
    while buf % 2 == 0 :
        count += 1
        buf = buf / 2
    if counter < count :
        counter  = count
        res = n
print(res)
# Buggy code:
N = int(input())
num_list = [64, 32, 16, 8, 4, 2]

for i in num_list:
  if N>=i:
    print(i)
    exit(0)

print(0)

# Fixed code:
N = int(input())
num_list = [64, 32, 16, 8, 4, 2, 1]

for i in num_list:
  if N>=i:
    print(i)
    exit(0)

print(0)
# Buggy code:
n = int(input())

count = 0
list_count = []
max_number = 0

for i in range(n):
    a = i + 1
    while a % 2 == 0:
        count += 1
        a /= 2
    list_count.append(count)
    if max(list_count) == count:
        max_number = i + 1

print(max_number)


# Fixed code:
n = int(input())

count = 0
list_count = []
max_number = 0

for i in range(n):
    a = i + 1
    while a % 2 == 0:
        count += 1
        a /= 2
    list_count.append(count)
    if max(list_count) == count:
        max_number = i + 1
    count = 0

print(max_number)
# Buggy code:
n=int(input())
ans=1
while(ans<=n):
    ans*2
print(ans//2)

# Fixed code:
n=int(input())
ans=1
while ans<=n:
    ans*=2
print(ans//2)
# Buggy code:
n = int(input())
data = [i*2 for i in range(1,n//2+1)]
def f(x):
    cnt = 0
    flg = 0
    while flg==0:
        if x%2==0:
            cnt += 1
            x = x/2
        else:
            flg = 1
    return cnt 
aim = 0
for i in data:
    if aim < f(i):
        aim = f(i)
        num = i
    else:
        continue
print(num)    

# Fixed code:
n = int(input())
data = [i*2 for i in range(1,n//2+1)]
def f(x):
    cnt = 0
    flg = 0
    while flg==0:
        if x%2==0:
            cnt += 1
            x = x/2
        else:
            flg = 1
    return cnt 
aim = 0
for i in data:
    if aim < f(i):
        aim = f(i)
        num = i
    else:
        continue
if n==1:
    print(1)
else:    
    print(num)
# Buggy code:
n = int(input())
l = [1, 2, 4, 8, 16, 32, 64]
i = 0
while l[i] < n:
  i += 1
else:
  print(l[i])


# Fixed code:
n = int(input())
l = [1, 2, 4, 8, 16, 32, 64, 128]
i = 0
while l[i] <= n:
  i += 1
else:
  print(l[i-1])
# Buggy code:
n=int(input())
ans=0
while 2**ans <n:
  ans+=1
print(2**ans)

# Fixed code:
n=int(input())
ans=0
while 2**ans <=n:
  ans+=1
print(2**(ans-1))
# Buggy code:
N = int(input())
num = 1

while num < N:
  num *= 2

print(num) 

# Fixed code:
N = int(input())
num = 1
 
while num*2 <= N:
  num *= 2
 
print(num)
# Buggy code:
N = int(input())
k = 0
while 1:
  if k**2 > N:
    break
  ans = k**2
  k += 1
print(ans)

# Fixed code:
N = int(input())
k = 0
while 1:
  if 2**k > N:
    break
  ans = 2**k
  k += 1
print(ans)
# Buggy code:
import numpy as np

n = int(input())
even_count = [0 for i in range(n+1)]
for i in range(1,n+1):
  j = i
  count = 0
  while True:
    if i % 2 == 0:
      count += 1
      i = int(i / 2)
    else:
      break
  even_count[j] = count
print(np.argmax(even_count))

# Fixed code:
import numpy as np

n = int(input())
even_count = [0 for i in range(n)]
for i in range(1,n+1):
  j = i
  count = 0
  while True:
    if i % 2 == 0:
      count += 1
      i = int(i / 2)
    else:
      break
  even_count[j-1] = count
print(np.argmax(even_count)+1)
# Buggy code:
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc068/tasks/abc068_b
import math

def fact(N):
    ans = {}
    for i in range(2, math.ceil(math.sqrt(N))+1):
        if N % i != 0:
            continue
        ex = 0

        while N % i == 0:
            ex += 1
            N /= i
        ans[i] = ex

    if N != 1:
        ans[int(N)] = 1
    return ans

N = int(input())
max_x = 0
max_n = 0

for i in range(N+1):
    num = fact(i)
    num = num.get(2, 0)
    if num > max_n:
        max_x = i
        max_n = num

print(max_x)


# Fixed code:
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc068/tasks/abc068_b
import math

def fact(N):
    ans = {}
    for i in range(2, math.ceil(math.sqrt(N))+1):
        if N % i != 0:
            continue
        ex = 0

        while N % i == 0:
            ex += 1
            N /= i
        ans[i] = ex

    if N != 1:
        ans[int(N)] = 1
    return ans

N = int(input())
max_x = 0
max_n = 0

if N == 1:
    print(1)
    exit()

for i in range(N+1):
    num = fact(i)
    num = num.get(2, 0)
    if num > max_n:
        max_x = i
        max_n = num

print(max_x)
# Buggy code:
N = int(input())
arr = [i for i in range(1, N + 1)]
# N == len(arr)
nums = N*[0]
for j in range(N):
    target = arr[j]
    num = 0
    while target % 2 == 0:
        num += 1
        target /= 2
    nums[j] = num
 
max_index = 0
for k in range(N):
    if nums[k] > max:
        max_index = k
 
print(arr[max_index])

# Fixed code:
N = int(input())
arr = [i for i in range(1, N + 1)]
# N == len(arr)
nums = N*[0]
for j in range(N):
    target = arr[j]
    num = 0
    while target % 2 == 0:
        num += 1
        target /= 2
    nums[j] = num

# print(nums)

max = 0
for k in range(N):
    if nums[k] > max:
        max_index = k
        max = nums[k]
    elif N == 1:
        max_index=0
 
print(arr[max_index])
# Buggy code:
N = int(input())
cnt_max = 0
ans = 0

for i in range(1, N):
    cnt = 0
    num = i
    while True:
        if num % 2 == 0:
            cnt += 1
            num /= 2
        else:
            break
    if cnt_max < cnt:
        cnt_max = cnt
        ans = i

print(ans)


# Fixed code:
N = int(input())
cnt_max = 0
ans = 1

for i in range(1, N + 1):
    cnt = 0
    num = i
    while True:
        if num % 2 == 0:
            cnt += 1
            num /= 2
        else:
            break
    if cnt_max < cnt:
        cnt_max = cnt
        ans = i

print(ans)
# Buggy code:
n = int(input())
results = 0
number = 0
for i in range(n):
    print(i)
    if i == 0:
        continue
    count = 0
    v = i + 1

    while v % 2 == 0:
        count += 1
        v = v / 2
    if results < count:
        results = count
        number = i + 1
    continue
print(number)

# Fixed code:
n = int(input())
results = 0
number = 0
for i in range(n + 1):
    if i == 0:
        continue
    if i == 1:
        number = 1
        continue
    count = 0
    v = i

    while v % 2 == 0:
        count += 1
        v = v / 2
    if results < count:
        results = count
        number = i
    continue
print(number)
# Buggy code:
def main():
    n=int(input())
    two_pow = 2
    while two_pow < n:
        two_pow *=2
    print(two_pow/2)
if __name__ == '__main__':
    main()


# Fixed code:
def main():
    n=int(input())
    two_pow = 2
    while two_pow <= n:
        two_pow *=2
    print(two_pow//2)
if __name__ == '__main__':
    main()
# Buggy code:
n = int(input())
a = []
b=[]

for i in range(1,n+1):
  a.append(i)
count = 0
print(a)
print(len(a),n)

for i in range(1,n+1):
  b.append(count)
  count = 0
  while True:
    if (a[i-1]%2) == 0:
      count += 1
      a[i-1] = a[i-1]/2
      print(a[i-1])
    else:
      break
  
print(max(b)+1)

# Fixed code:
n = int(input())
a = []
b=[]

for i in range(1,n+1):
  a.append(i)
count = 0


for i in range(1,n+1):
  
  count = 0
  while True:
    if (a[i-1]%2) == 0:
      count += 1
      a[i-1] = a[i-1]/2
      
    else:
      break
  b.append(count)


c =max(b)
print(b.index(c)+1)
# Buggy code:
""" AtCoder """

N = int(input())
ans_list = [1, 2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

for i in range(7):
    if N > ans_list[i]:
        print(ans_list[i])
        break


# Fixed code:
""" AtCoder """

N = int(input())
ans_list = [2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

if N == 1:
    print(1)
    exit()

for i in range(7):
    if N >= ans_list[i]:
        print(ans_list[i])
        break
# Buggy code:
N,P = map(int,input().split(" "))
A = list(map(int,input().split(" ")))
B = [1,0]
for _ in range(N):
    a = A.pop()%2
    p,q = B
    B = [p+q,q+p] 
print(B[P])

# Fixed code:
N,P = map(int,input().split(" "))
A = list(map(int,input().split(" ")))
B = [1,0]
for _ in range(N):
    a = A.pop()%2
    p,q = B
    B = [p+q,q+p] if a else [2*p,2*q]
print(B[P])
# Buggy code:
import math

def C(n, r):
    if (n == r or r == 0):
        return 1
    if (r > n):
        return 0

    ret = math.factorial(n) / math.factorial(r) / math.factorial(n - r)
    return int(ret)


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

odd = even = 0
ans = 0

for i in range(n):
    if (x[i] % 2 == 0):
        even+=1
    else:
        odd+=1

for i in range(n + 1):
    for j in range(i + 1):
        if (p == 1 and j % 2 == 1) or(p == 0 and j % 2 == 0):
            ans += C(even, i - j) * C(odd, j)

print(ans)


# Fixed code:
import math

def C(n, r):
    if (n == r or r == 0):
        return 1
    if (r > n):
        return 0
    f = math.factorial

    ret = f(n) / (f(r) * f(n - r))
    return int(ret)


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

odd = even = ans = 0

for i in range(n):
    if (x[i] % 2 == 0):
        even+=1
    else:
        odd+=1

print("")

for i in range(n + 1):
    for j in range(i + 1):
        if (p == 1 and j % 2 == 1) or (p == 0 and j % 2 == 0):
            ans += C(even, i - j) * C(odd, j)

print(ans)
# Buggy code:
n,k = map(int,input().split())
lst = list(map(int,input().split()))
e,o = 0,0
for i in range(n):
    if lst[i]%2==0:
        e += 1
    else:
        o += 1

if o==0:
    if p==0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))

# Fixed code:
n,k = map(int,input().split())
lst = list(map(int,input().split()))
e,o = 0,0
for i in range(n):
    if lst[i]%2==0:
        e += 1
    else:
        o += 1

if o==0:
    if k==0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))
# Buggy code:
import collections
n, p = list(map(int, input().split()))
a = list(map(int, input().split()))
a2 = [ai%2 for ai in a]
a2 = collections.Counter(a2)

if p == 0:
  if a2[1] == 0:
    print(2 ** n)
  else:
    print(2 ** (n - 1))
    
else:
  print(2 ** (n-1))



# Fixed code:
import collections
n, p = list(map(int, input().split()))
a = list(map(int, input().split()))
a2 = [ai%2 for ai in a]
a2 = collections.Counter(a2)

if p == 0:
  if a2[1] == 0:
    print(2 ** n)
  else:
    print(2 ** (n - 1))
    
else:
  if a2[1] == 0:
    print(0)
  else:
    print(2 ** (n-1))
# Buggy code:
N, P = map(int,input().split())
A = list(map(int,input().split()))
odd = len(list(filter(lambda x:x%2==1 ,A)))
even = N-odd
if odd == 0:
    print(2**(N))
else:
    print(2**(N-1))


# Fixed code:
N, P = map(int,input().split())
A = list(map(int,input().split()))
odd = len(list(filter(lambda x:x%2==1 ,A)))
even = N-odd
if odd == 0:
    if P == 0:print(2**(N))
    else:print(0)
else:
    print(2**(N-1))
# Buggy code:
import math


def comb(n, r):
    return math.factorial(n) / math.factorial(r) / math.factorial(n - r)


def main():
    n, p = map(int, input().split())
    a = tuple(map(lambda x: int(x) % 2 == 0, input().split()))

    if n == 1 and a[0] == bool(p):
        print(0)
        return 0

    t = len(tuple(filter(lambda x: x, a)))
    f = n - t

    f_comb = 0
    for j in range(f + 1):
        f_comb += comb(f, j)

    t_comb = 0
    if p == 0:
        for i in range(t + 1):
            if i % 2 == 0:
                t_comb += comb(t, i)
    else:
        for i in range(t + 1):
            if i % 2 == 1:
                t_comb += comb(t, i)

    print(int(t_comb * f_comb))

    return 0


if __name__ == '__main__':
    main()


# Fixed code:
import math


def comb(n, r):
    return math.factorial(n) / math.factorial(r) / math.factorial(n - r)


def main():
    n, p = map(int, input().split())
    a = tuple(map(lambda x: int(x) % 2, input().split()))

    if n == 1 and a[0] % 2 != p:
        print(0)
        return 0

    t = len(tuple(filter(lambda x: x == 1, a)))
    f = n - t

    f_comb = 0
    for j in range(f + 1):
        f_comb += comb(f, j)

    t_comb = 0
    if p == 0:
        for i in range(t + 1):
            if i % 2 == 0:
                t_comb += comb(t, i)
    else:
        for i in range(t + 1):
            if i % 2 == 1:
                t_comb += comb(t, i)

    print(int(t_comb * f_comb))

    return 0


if __name__ == '__main__':
    main()
# Buggy code:
import math
def comb(n,r):
  return int(math.factorial(n)/(math.factorial(r)*math.factorial(n-r)))

N,P=map(int,input().split())
A=list(map(int,input().split()))
odd=0
even=0
total=0
for i in range(N):
  total+=A[i]
  if A[i]%2==0:
    even+=1
  else: 
    odd+=1
total=total%2
evens=2**even

ans=0
if total==even%2:
  for i in range(int((odd+1)/2)): 
    ans+=comb(odd,2*i)
    print(comb(odd,2*i))
else:
  for i in range(int((odd+1)/2)):
    ans+=comb(odd,2*i+1)
    print(comb(odd,2*i+1))
print(ans*evens)

# Fixed code:
import math
N, P = map(int, input().split())
A = list(map(int, input().split()))
even = 0
odd = 0
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(N):
    if A[i] % 2 == 0:
        even += 1
    else:
        odd += 1

oddcmb = 0
if P == 0:
    for i in range(odd+1)[::2]:
        # print(i)
        oddcmb += comb(odd, i)
    ans = 2**even*oddcmb
    # oddcmb = comb()
else:
    for i in range(1, odd+1)[::2]:
        # print(i)
        oddcmb += comb(odd, i)
    ans = 2**even*oddcmb

print(ans)
# Buggy code:
#!/usr/bin/env python3
#AGC17 A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7

n,p = map(int,sys.stdin.readline().split())
a = list(map(int,sys.stdin.readline().split()))
def comb(n,r):
    return math.factorial(n)/math.factorial(n-r)/math.factorial(r)
x = list(map(lambda x:x % 2,a))
c = x.count(1)
ans = 0
if p:
    for i in range(c+1):
        if i % 2:
            for j in range(n-c+1):
                ans += comb(c,i)*comb(n-c,j)
else:
    for i in range(c+1):
        if i % 2 == 0:
            for j in range(n-c+1):
                if j % 2 == 0:
                    ans += comb(c,i)*comb(n-c,j)
print(ans)


# Fixed code:
#!/usr/bin/env python3
#AGC17 A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7

n,p = map(int,sys.stdin.readline().split())
a = list(map(int,sys.stdin.readline().split()))
fact = [1]*51
for i in range(1,51):
    fact[i] = fact[i-1]*i
def comb(n,r):
    return fact[n]//fact[n-r]//fact[r]
x = list(map(lambda x:x % 2,a))
c = x.count(1)
ans = 0
if p:
    for i in range(c+1):
        if i % 2:
            for j in range(n-c+1):
                ans += comb(c,i)*comb(n-c,j)
else:
    for i in range(c+1):
        if i % 2 == 0:
            for j in range(n-c+1):
                ans += comb(c,i)*comb(n-c,j)
print(ans)
# Buggy code:
N, P = list(map(int, input().split()))
A = list(map(int, input().split()))

ev = 0
ad = 0
for i in A:
  if i % 2 == 0:
    ev += 1
  else:
    ad += 1

R = 1
if P == 1:
  if ad == 0:
    print("0")
    exit()
  R = ad
  ad -= 1
  

f = [1, 1]
for i in range(2, ad + 1):
  f.append(f[-1] * i)
num = 1
for i in range(2, ad + 1, 2):
  num += f[ad] // (f[i] * f[ad - i])

print(pow(2, ev) * num * R)



# Fixed code:
N, P = list(map(int, input().split()))
A = list(map(int, input().split()))

ev = 0
ad = 0
for i in A:
  if i % 2 == 0:
    ev += 1
  else:
    ad += 1

if P == 1:
  if ad == 0:
    print("0")
    exit()
  

f = [1, 1]
for i in range(2, ad + 1):
  f.append(f[-1] * i)
num = 0
for i in range(P, ad + 1, 2):
  num += f[ad] // (f[i] * f[ad - i])

print(pow(2, ev) * num)
# Buggy code:
import math
N,P = map(int,input().split())
A = [i%2 for i in list(map(int,input().split()))]
odd,even = A.count(1),A.count(0)
sumo = 0
for i in range(0,odd+1,P+1):
    sumo += int(math.factorial(odd)//(math.factorial(odd-i)*math.factorial(i)))
print(sumo*(2**even))

# Fixed code:
import math
N,P = map(int,input().split())
A = list(map(int,input().split()))
A = [i%2 for i in A]
odd = A.count(1)
even = A.count(0)
sumo = 0
for i in range(odd+1):
    if i%2 == P:
        sumo += int(math.factorial(odd)//(math.factorial(odd-i)*math.factorial(i)))
ans = sumo*(2**even)
print(ans)