import sys

import math

import fractions

import bisect

import queue

import heapq

from collections import deque

sys.setrecursionlimit(4100000)



MOD = int(1e9+7)

PI = 3.14159265358979323846264338327950288

INF = 1e18



'''

1行のint

N, K = map(int, input().split())



1行のstring

S, T = input().split()



1行の整数配列

P = list(map(int,input().split()))



改行あり

x = []

y = []

for i in range(N):

    x1,y1=[int(i) for i in input().split()]

    x.append(x1)

    y.append(y1)



N行M列の初期化

dp = [[INF] * M for i in range(N)]



'''



"""""""""""""""""""""""""""""""""

 最大公約数 O()

"""""""""""""""""""""""""""""""""

# fractions.gcd(a,b)

def gcd(a, b):

    return fractions.gcd(a, b)



"""""""""""""""""""""""""""""""""

 最小公倍数 O()

"""""""""""""""""""""""""""""""""

def lcm(a,b):

    return (a*b) // fractions.gcd(a,b)





N, M = list(map(int, input().split()))

A = list(map(int,input().split()))





twice = 1

while True:

    if A[0] % (twice*2) == 0:

        twice*=2

    else:

        break



for a in A:

    if a%twice != 0:

        print((0))

        sys.exit()

    elif a%(twice*2) == 0:

        print((0))

        sys.exit()





half = 1 # 最小公倍数の二分の一

for i in range(N):

    A[i] //= 2

    half = lcm(half, A[i])



ans = (M//half) // 2 + int((M//half)%2 == 1)

print((int(ans)))











"""

ATTENTION: Pythonで間に合うか？？



            <目安>

 文字列結合、再帰関数を含む→Python

 上を含まず時間が不安→PyPy3



"""
import sys

import math

import fractions

import bisect

import queue

import heapq

from collections import deque

sys.setrecursionlimit(4100000)



MOD = int(1e9+7)

PI = 3.14159265358979323846264338327950288

INF = 1e18



'''

1行のint

N, K = map(int, input().split())



1行のstring

S, T = input().split()



1行の整数配列

P = list(map(int,input().split()))



改行あり

x = []

y = []

for i in range(N):

    x1,y1=[int(i) for i in input().split()]

    x.append(x1)

    y.append(y1)



N行M列の初期化

dp = [[INF] * M for i in range(N)]



'''



"""""""""""""""""""""""""""""""""

 最大公約数 O()

"""""""""""""""""""""""""""""""""

# fractions.gcd(a,b)

def gcd(a, b):

    return fractions.gcd(a, b)



"""""""""""""""""""""""""""""""""

 最小公倍数 O()

"""""""""""""""""""""""""""""""""

def lcm(a,b):

    return (a*b) // fractions.gcd(a,b)





N, M = list(map(int, input().split()))

A = list(map(int,input().split()))





twice = 1

while True:

    if A[0] % (twice*2) == 0:

        twice*=2

    else:

        break



for a in A:

    if a%twice != 0:

        print((0))

        sys.exit()

    elif a%(twice*2) == 0:

        print((0))

        sys.exit()





half = 1

for a in A:

    half = lcm(half, a//2)



ans = (M//half + 1) // 2

print((int(ans)))







import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque

sys.setrecursionlimit(4100000)
MOD = int(1e9 + 7)
PI = 3.14159265358979323846264338327950288
INF = 1e18
"""
1行のint
N, K = map(int, input().split())
1行のstring
S, T = input().split()
1行の整数配列
P = list(map(int,input().split()))
改行あり
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
N行M列の初期化
dp = [[INF] * M for i in range(N)]
"""
"""""" """""" """""" """""" """""" """
 最大公約数 O()
""" """""" """""" """""" """""" """"""
# fractions.gcd(a,b)
def gcd(a, b):
    return fractions.gcd(a, b)


"""""" """""" """""" """""" """""" """
 最小公倍数 O()
""" """""" """""" """""" """""" """"""


def lcm(a, b):
    return (a * b) // fractions.gcd(a, b)


N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
twice = 1
while True:
    if A[0] % (twice * 2) == 0:
        twice *= 2
    else:
        break
for a in A:
    if a % twice != 0:
        print((0))
        sys.exit()
    elif a % (twice * 2) == 0:
        print((0))
        sys.exit()
half = 1  # 最小公倍数の二分の一
for i in range(N):
    A[i] //= 2
    half = lcm(half, A[i])
ans = (M // half) // 2 + int((M // half) % 2 == 1)
print((int(ans)))
"""
ATTENTION: Pythonで間に合うか？？
            <目安>
 文字列結合、再帰関数を含む→Python
 上を含まず時間が不安→PyPy3
"""

import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque

sys.setrecursionlimit(4100000)
MOD = int(1e9 + 7)
PI = 3.14159265358979323846264338327950288
INF = 1e18
"""
1行のint
N, K = map(int, input().split())
1行のstring
S, T = input().split()
1行の整数配列
P = list(map(int,input().split()))
改行あり
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
N行M列の初期化
dp = [[INF] * M for i in range(N)]
"""
"""""" """""" """""" """""" """""" """
 最大公約数 O()
""" """""" """""" """""" """""" """"""
# fractions.gcd(a,b)
def gcd(a, b):
    return fractions.gcd(a, b)


"""""" """""" """""" """""" """""" """
 最小公倍数 O()
""" """""" """""" """""" """""" """"""


def lcm(a, b):
    return (a * b) // fractions.gcd(a, b)


N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
twice = 1
while True:
    if A[0] % (twice * 2) == 0:
        twice *= 2
    else:
        break
for a in A:
    if a % twice != 0:
        print((0))
        sys.exit()
    elif a % (twice * 2) == 0:
        print((0))
        sys.exit()
half = 1
for a in A:
    half = lcm(half, a // 2)
ans = (M // half + 1) // 2
print((int(ans)))

-half = 1  # 最小公倍数の二分の一 -for i in range(N): -    A[i] //= 2 -    half = lcm(half, A[i]) -ans = (M // half) // 2 + int((M // half) % 2 == 1) +half = 1 +for a in A: +    half = lcm(half, a // 2) +ans = (M // half + 1) // 2 -""" -ATTENTION: Pythonで間に合うか？？ -            <目安> - 文字列結合、再帰関数を含む→Python - 上を含まず時間が不安→PyPy3 -"""