import Data.List

main = do
   [n,m] <- map (read) . words <$> getLine :: IO [Int]
   as <- map (half . read) . words <$> getLine :: IO [Int]
   putStrLn $ show (ans m as)

ans :: Int -> [Int] -> Int
ans m as = f (foldl1 (lcm1 m) as) m

lcm1 :: Int -> Int -> Int -> Int
lcm1 m a b
  | lcm a b > m = m+1
  | otherwise = lcm a b

half :: Int -> Int
half a = a `div` 2

f :: Int -> Int -> Int
f a m = (m + a) `div` (2 * a)
