#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: nofree norecurse nosync nounwind 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.body

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

for.body:                                         ; preds = %entry, %for.body
  %0 = phi i64 [ 1, %entry ], [ %rem18, %for.body ]
  %1 = phi i64 [ 1, %entry ], [ %rem, %for.body ]
  %indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.body ]
  %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
  %exitcond.not = icmp eq i64 %indvars.iv.next, 101
  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}

; 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: mustprogress nofree norecurse nosync nounwind 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: nofree nounwind 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
  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.body.i

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

COMinit.exit:                                     ; preds = %for.body.i
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p)
  %4 = load i32, ptr %n, align 4, !tbaa !9
  %cmp34 = icmp sgt i32 %4, 0
  br i1 %cmp34, label %for.body, label %for.cond.cleanup8

for.cond6.preheader:                              ; preds = %for.body
  %cmp739 = icmp sgt i32 %a.1, 0
  br i1 %cmp739, label %for.body9.preheader, label %for.cond.cleanup8

for.body9.preheader:                              ; preds = %for.cond6.preheader
  %5 = add i32 %a.035, -1
  %6 = and i32 %10, 1
  %7 = xor i32 %6, 1
  %8 = add i32 %5, %7
  %xtraiter = and i32 %a.1, 7
  %9 = icmp ult i32 %8, 7
  br i1 %9, label %for.cond.cleanup8.loopexit.unr-lcssa, label %for.body9.preheader.new

for.body9.preheader.new:                          ; preds = %for.body9.preheader
  %unroll_iter = and i32 %a.1, -8
  br label %for.body9

for.body:                                         ; preds = %COMinit.exit, %for.body
  %i.037 = phi i32 [ %inc4, %for.body ], [ 0, %COMinit.exit ]
  %b.036 = phi i32 [ %b.1, %for.body ], [ 0, %COMinit.exit ]
  %a.035 = phi i32 [ %a.1, %for.body ], [ 0, %COMinit.exit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
  %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
  %10 = load i32, ptr %x, align 4, !tbaa !9
  %11 = and i32 %10, 1
  %12 = xor i32 %11, 1
  %a.1 = add i32 %12, %a.035
  %b.1 = add i32 %11, %b.036
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
  %inc4 = add nuw nsw i32 %i.037, 1
  %13 = load i32, ptr %n, align 4, !tbaa !9
  %cmp = icmp slt i32 %inc4, %13
  br i1 %cmp, label %for.body, label %for.cond6.preheader

for.cond.cleanup8.loopexit.unr-lcssa:             ; preds = %for.body9, %for.body9.preheader
  %mul.lcssa.ph = phi i64 [ undef, %for.body9.preheader ], [ %mul, %for.body9 ]
  %A.040.unr = phi i64 [ 1, %for.body9.preheader ], [ %mul, %for.body9 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %for.cond.cleanup8, label %for.body9.epil

for.body9.epil:                                   ; preds = %for.cond.cleanup8.loopexit.unr-lcssa, %for.body9.epil
  %A.040.epil = phi i64 [ %mul.epil, %for.body9.epil ], [ %A.040.unr, %for.cond.cleanup8.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.cond.cleanup8.loopexit.unr-lcssa ]
  %mul.epil = shl nsw i64 %A.040.epil, 1
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %for.cond.cleanup8, label %for.body9.epil, !llvm.loop !11

for.cond.cleanup8:                                ; preds = %for.cond.cleanup8.loopexit.unr-lcssa, %for.body9.epil, %COMinit.exit, %for.cond6.preheader
  %b.0.lcssa52 = phi i32 [ %b.1, %for.cond6.preheader ], [ 0, %COMinit.exit ], [ %b.1, %for.body9.epil ], [ %b.1, %for.cond.cleanup8.loopexit.unr-lcssa ]
  %A.0.lcssa = phi i64 [ 1, %for.cond6.preheader ], [ 1, %COMinit.exit ], [ %mul.lcssa.ph, %for.cond.cleanup8.loopexit.unr-lcssa ], [ %mul.epil, %for.body9.epil ]
  %14 = load i32, ptr %p, align 4, !tbaa !9
  %cmp14.not43 = icmp sgt i32 %14, %b.0.lcssa52
  br i1 %cmp14.not43, label %for.cond.cleanup15, label %for.body16.lr.ph

for.body16.lr.ph:                                 ; preds = %for.cond.cleanup8
  %idxprom.i = zext i32 %b.0.lcssa52 to i64
  %arrayidx.i = getelementptr inbounds [101 x i64], ptr @fac, i64 0, i64 %idxprom.i
  %15 = sext i32 %14 to i64
  %16 = sext i32 %b.0.lcssa52 to i64
  br label %for.body16

for.body9:                                        ; preds = %for.body9, %for.body9.preheader.new
  %A.040 = phi i64 [ 1, %for.body9.preheader.new ], [ %mul, %for.body9 ]
  %niter = phi i32 [ 0, %for.body9.preheader.new ], [ %niter.next.7, %for.body9 ]
  %mul = shl i64 %A.040, 8
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %for.cond.cleanup8.loopexit.unr-lcssa, label %for.body9

for.cond.cleanup15:                               ; preds = %COM.exit, %for.cond.cleanup8
  %B.0.lcssa = phi i64 [ 0, %for.cond.cleanup8 ], [ %add, %COM.exit ]
  %mul21 = mul nsw i64 %B.0.lcssa, %A.0.lcssa
  %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul21)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
  ret i32 0

for.body16:                                       ; preds = %for.body16.lr.ph, %COM.exit
  %indvars.iv = phi i64 [ %15, %for.body16.lr.ph ], [ %indvars.iv.next, %COM.exit ]
  %B.044 = phi i64 [ 0, %for.body16.lr.ph ], [ %add, %COM.exit ]
  %17 = trunc i64 %indvars.iv to i32
  %18 = or i32 %b.0.lcssa52, %17
  %or.cond.not.i = icmp sgt i32 %18, -1
  br i1 %or.cond.not.i, label %if.end4.i, label %COM.exit

if.end4.i:                                        ; preds = %for.body16
  %19 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
  %idxprom5.i = and i64 %indvars.iv, 4294967295
  %arrayidx6.i = getelementptr inbounds [101 x i64], ptr @finv, i64 0, i64 %idxprom5.i
  %20 = load i64, ptr %arrayidx6.i, align 8, !tbaa !5
  %21 = sub nsw i64 %16, %indvars.iv
  %arrayidx8.i = getelementptr inbounds [101 x i64], ptr @finv, i64 0, i64 %21
  %22 = load i64, ptr %arrayidx8.i, align 8, !tbaa !5
  %mul.i32 = mul nsw i64 %22, %20
  %rem.i33 = srem i64 %mul.i32, 1000000007
  %mul9.i = mul nsw i64 %rem.i33, %19
  %rem10.i = srem i64 %mul9.i, 1000000007
  br label %COM.exit

COM.exit:                                         ; preds = %for.body16, %if.end4.i
  %retval.0.i = phi i64 [ %rem10.i, %if.end4.i ], [ 0, %for.body16 ]
  %add = add nsw i64 %retval.0.i, %B.044
  %indvars.iv.next = add nsw i64 %indvars.iv, 2
  %cmp14.not = icmp sgt i64 %indvars.iv.next, %16
  br i1 %cmp14.not, label %for.cond.cleanup15, label %for.body16
}

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

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

attributes #0 = { nofree norecurse nosync nounwind 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 = { mustprogress nofree norecurse nosync nounwind 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 = { nofree nounwind 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 = { nofree nounwind "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 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
