N,W=map(int,input().split()) A=list(map(int,input().split())) ANS=0 if W==0: X=0 for a in A: if a==0: X+=1 print(pow(2,X)-1) exit() for j in range(1<