main=do
 [n,m]<-map read.words<$>getLine
 a<-map read.words<$>getLine
 let b=map f$a
 let ans=if all(b!!0==)b then (`div`2)(foldl1 lcm a) else -1
 print$if ans== -1 then 0 else if ans>m then 0 else ((m`div`ans)+1)`div`2
f k
 |k`mod`2==0=1+f(div k 2)
 |True=0