import qualified Data.Set as S
f 0 i _ = i
f n i l = f (n-1) (lcm i (head l)) (tail l)
main=do
 [n,m]<-map read.words<$>getLine
 a<-map ((\x->quot x 2).read).words<$>getLine
 let b = f n 1 a
 print(if(even b)then(if(S.size(S.fromList a))>0 then 0 else(quot((quot m b)+1)2))else(quot((quot m b)+1)2))