n,p,*a=map(int,open(0).read().split()) x=1 for i in range(n): x*=1-p x=1-x if n>=200:x=1 print(x)