#import <stdio.h>

const int MAX = 101;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++){
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k){
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
	COMinit();

	int n,p;
	scanf("%d %d",&n,&p);
	int a = 0;
	int b = 0;
	for(int i=0;i<n;i++){
		int x;
		scanf("%d",&x);
		x%2==0 ? a++ : b++;
	}
	long long A = 1;
	long long B = 0;
	for(int i=0;i<a;i++) A*=2;
	for(int k=p;k<=b;k+=2) B+=COM(b,k);
	printf("%lld\n",A*B);
}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_749/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_749/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@MAX = dso_local local_unnamed_addr constant i32 101, align 4
@MOD = dso_local local_unnamed_addr constant i32 1000000007, align 4
@fac = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@finv = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@inv = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1

; Function Attrs: minsize nofree norecurse nosync nounwind optsize memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @COMinit() local_unnamed_addr #0 {
entry:
  store i64 1, ptr getelementptr inbounds ([101 x i64], ptr @fac, i64 0, i64 1), align 8, !tbaa !5
  store i64 1, ptr @fac, align 16, !tbaa !5
  store i64 1, ptr getelementptr inbounds ([101 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5
  store i64 1, ptr @finv, align 16, !tbaa !5
  store i64 1, ptr getelementptr inbounds ([101 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5
  br label %for.cond

for.cond:                                         ; preds = %for.body, %entry
  %0 = phi i64 [ %rem18, %for.body ], [ 1, %entry ]
  %1 = phi i64 [ %rem, %for.body ], [ 1, %entry ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 2, %entry ]
  %exitcond.not = icmp eq i64 %indvars.iv, 101
  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body

for.cond.cleanup:                                 ; preds = %for.cond
  ret void

for.body:                                         ; preds = %for.cond
  %mul = mul nsw i64 %1, %indvars.iv
  %rem = srem i64 %mul, 1000000007
  %arrayidx2 = getelementptr inbounds [101 x i64], ptr @fac, i64 0, i64 %indvars.iv
  store i64 %rem, ptr %arrayidx2, align 8, !tbaa !5
  %2 = trunc i64 %indvars.iv to i32
  %rem3 = urem i32 1000000007, %2
  %idxprom4 = zext i32 %rem3 to i64
  %arrayidx5 = getelementptr inbounds [101 x i64], ptr @inv, i64 0, i64 %idxprom4
  %3 = load i64, ptr %arrayidx5, align 8, !tbaa !5
  %div = udiv i32 1000000007, %2
  %conv6 = zext i32 %div to i64
  %mul7 = mul nsw i64 %3, %conv6
  %rem8 = srem i64 %mul7, 1000000007
  %sub9 = sub nsw i64 1000000007, %rem8
  %arrayidx11 = getelementptr inbounds [101 x i64], ptr @inv, i64 0, i64 %indvars.iv
  store i64 %sub9, ptr %arrayidx11, align 8, !tbaa !5
  %mul17 = mul nuw nsw i64 %sub9, %0
  %rem18 = urem i64 %mul17, 1000000007
  %arrayidx20 = getelementptr inbounds [101 x i64], ptr @finv, i64 0, i64 %indvars.iv
  store i64 %rem18, ptr %arrayidx20, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %for.cond
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @COM(i32 noundef %n, i32 noundef %k) local_unnamed_addr #2 {
entry:
  %cmp = icmp sge i32 %n, %k
  %0 = or i32 %k, %n
  %or.cond.not = icmp sgt i32 %0, -1
  %or.cond = and i1 %cmp, %or.cond.not
  br i1 %or.cond, label %if.end4, label %return

if.end4:                                          ; preds = %entry
  %idxprom = zext i32 %n to i64
  %arrayidx = getelementptr inbounds [101 x i64], ptr @fac, i64 0, i64 %idxprom
  %1 = load i64, ptr %arrayidx, align 8, !tbaa !5
  %idxprom5 = zext i32 %k to i64
  %arrayidx6 = getelementptr inbounds [101 x i64], ptr @finv, i64 0, i64 %idxprom5
  %2 = load i64, ptr %arrayidx6, align 8, !tbaa !5
  %sub = sub nsw i32 %n, %k
  %idxprom7 = sext i32 %sub to i64
  %arrayidx8 = getelementptr inbounds [101 x i64], ptr @finv, i64 0, i64 %idxprom7
  %3 = load i64, ptr %arrayidx8, align 8, !tbaa !5
  %mul = mul nsw i64 %3, %2
  %rem = srem i64 %mul, 1000000007
  %mul9 = mul nsw i64 %rem, %1
  %rem10 = srem i64 %mul9, 1000000007
  br label %return

return:                                           ; preds = %entry, %if.end4
  %retval.0 = phi i64 [ %rem10, %if.end4 ], [ 0, %entry ]
  ret i64 %retval.0
}

; Function Attrs: minsize nofree nounwind optsize uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
  %n = alloca i32, align 4
  %p = alloca i32, align 4
  %x = alloca i32, align 4
  tail call void @COMinit() #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #7
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) #6
  br label %for.cond

for.cond:                                         ; preds = %for.body, %entry
  %a.0 = phi i32 [ 0, %entry ], [ %a.1, %for.body ]
  %b.0 = phi i32 [ 0, %entry ], [ %b.1, %for.body ]
  %i.0 = phi i32 [ 0, %entry ], [ %inc4, %for.body ]
  %0 = load i32, ptr %n, align 4, !tbaa !9
  %cmp = icmp slt i32 %i.0, %0
  br i1 %cmp, label %for.body, label %for.cond6.preheader

for.cond6.preheader:                              ; preds = %for.cond
  %smax = call i32 @llvm.smax.i32(i32 %a.0, i32 0)
  br label %for.cond6

for.body:                                         ; preds = %for.cond
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7
  %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) #6
  %1 = load i32, ptr %x, align 4, !tbaa !9
  %2 = and i32 %1, 1
  %3 = xor i32 %2, 1
  %a.1 = add i32 %3, %a.0
  %b.1 = add i32 %2, %b.0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7
  %inc4 = add nuw nsw i32 %i.0, 1
  br label %for.cond

for.cond6:                                        ; preds = %for.cond6.preheader, %for.body9
  %A.0 = phi i64 [ %mul, %for.body9 ], [ 1, %for.cond6.preheader ]
  %i5.0 = phi i32 [ %inc11, %for.body9 ], [ 0, %for.cond6.preheader ]
  %exitcond.not = icmp eq i32 %i5.0, %smax
  br i1 %exitcond.not, label %for.cond.cleanup8, label %for.body9

for.cond.cleanup8:                                ; preds = %for.cond6
  %4 = load i32, ptr %p, align 4, !tbaa !9
  br label %for.cond13

for.body9:                                        ; preds = %for.cond6
  %mul = shl nsw i64 %A.0, 1
  %inc11 = add nuw i32 %i5.0, 1
  br label %for.cond6

for.cond13:                                       ; preds = %for.body16, %for.cond.cleanup8
  %B.0 = phi i64 [ 0, %for.cond.cleanup8 ], [ %add, %for.body16 ]
  %k.0 = phi i32 [ %4, %for.cond.cleanup8 ], [ %add19, %for.body16 ]
  %cmp14.not = icmp sgt i32 %k.0, %b.0
  br i1 %cmp14.not, label %for.cond.cleanup15, label %for.body16

for.cond.cleanup15:                               ; preds = %for.cond13
  %mul21 = mul nsw i64 %B.0, %A.0
  %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
  ret i32 0

for.body16:                                       ; preds = %for.cond13
  %call17 = call i64 @COM(i32 noundef %b.0, i32 noundef %k.0) #6, !range !11
  %add = add nsw i64 %call17, %B.0
  %add19 = add nsw i32 %k.0, 2
  br label %for.cond13
}

; Function Attrs: minsize nofree nounwind optsize
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: minsize nofree nounwind optsize
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

attributes #0 = { minsize nofree norecurse nosync nounwind optsize memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { minsize nofree nounwind optsize uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { minsize nofree nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { minsize optsize }
attributes #7 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 -1000000006, i64 1000000007}
