from functools import reduce

from fractions import gcd



def lcm(a, b):

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

def lcm_all(A):

    return reduce(lcm, A, 1)



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

A = tuple([int(x)//2 for x in input().split()])



scm_core = lcm_all(A)



canmake_scm = True

for a in A:

    if scm_core // a % 2 == 0:

        canmake_scm = False

        break



if canmake_scm:

    print((((M // scm_core)+1) // 2))

else:

    print((0))
from functools import reduce

from fractions import gcd



def lcm(a, b):

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

def lcm_all(A):

    return reduce(lcm, A, 1)



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

A = set([int(x)//2 for x in input().split()])



scm_core = lcm_all(A)



canmake_scm = True

for a in A:

    if scm_core // a % 2 == 0:

        canmake_scm = False

        break



if canmake_scm:

    print((((M // scm_core)+1) // 2))

else:

    print((0))
from functools import reduce
from fractions import gcd


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


def lcm_all(A):
    return reduce(lcm, A, 1)


n, M = list(map(int, input().split()))
A = tuple([int(x) // 2 for x in input().split()])
scm_core = lcm_all(A)
canmake_scm = True
for a in A:
    if scm_core // a % 2 == 0:
        canmake_scm = False
        break
if canmake_scm:
    print((((M // scm_core) + 1) // 2))
else:
    print((0))

from functools import reduce
from fractions import gcd


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


def lcm_all(A):
    return reduce(lcm, A, 1)


n, M = list(map(int, input().split()))
A = set([int(x) // 2 for x in input().split()])
scm_core = lcm_all(A)
canmake_scm = True
for a in A:
    if scm_core // a % 2 == 0:
        canmake_scm = False
        break
if canmake_scm:
    print((((M // scm_core) + 1) // 2))
else:
    print((0))

-A = tuple([int(x) // 2 for x in input().split()]) +A = set([int(x) // 2 for x in input().split()])