from functools import reduce

import fractions

import numpy as np



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

a = np.array(list(map(int, input().split())))



a = a // 2



def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)



def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)



l = lcm(*a)

exist = not 0 in ((l//a)%2)



if exist:

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

else:

    print((0))
import sys, fractions, functools

input = lambda: sys.stdin.readline().rstrip() 

sys.setrecursionlimit(10**7)

INF = 10**20

def I(): return int(eval(input()))

def F(): return float(eval(input()))

def S(): return eval(input())

def LI(): return [int(x) for x in input().split()]

def LI_(): return [int(x)-1 for x in input().split()]

def LF(): return [float(x) for x in input().split()]

def LS(): return input().split()



def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)



def lcm_list(numbers):

    return functools.reduce(lcm_base, numbers, 1)



def resolve():

    N, M = LI()

    a = LI()



    a_half = [i//2 for i in a]

    a_half_lcm = lcm_list(a_half)

    has_scm = not 0 in [a_half_lcm//i%2 for i in a_half]



    if has_scm:

        print(((M-a_half_lcm)//(2*a_half_lcm)+1))

    else:

        print((0))



if __name__ == '__main__':

    resolve()
from functools import reduce
import fractions
import numpy as np

N, M = list(map(int, input().split()))
a = np.array(list(map(int, input().split())))
a = a // 2


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


l = lcm(*a)
exist = not 0 in ((l // a) % 2)
if exist:
    print(((M // l + 1) // 2))
else:
    print((0))

import sys, fractions, functools

input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
INF = 10**20


def I():
    return int(eval(input()))


def F():
    return float(eval(input()))


def S():
    return eval(input())


def LI():
    return [int(x) for x in input().split()]


def LI_():
    return [int(x) - 1 for x in input().split()]


def LF():
    return [float(x) for x in input().split()]


def LS():
    return input().split()


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)


def resolve():
    N, M = LI()
    a = LI()
    a_half = [i // 2 for i in a]
    a_half_lcm = lcm_list(a_half)
    has_scm = not 0 in [a_half_lcm // i % 2 for i in a_half]
    if has_scm:
        print(((M - a_half_lcm) // (2 * a_half_lcm) + 1))
    else:
        print((0))


if __name__ == "__main__":
    resolve()

-from functools import reduce -import fractions -import numpy as np +import sys, fractions, functools -N, M = list(map(int, input().split())) -a = np.array(list(map(int, input().split()))) -a = a // 2 +input = lambda: sys.stdin.readline().rstrip() +sys.setrecursionlimit(10**7) +INF = 10**20 + + +def I(): +    return int(eval(input())) + + +def F(): +    return float(eval(input())) + + +def S(): +    return eval(input()) + + +def LI(): +    return [int(x) for x in input().split()] + + +def LI_(): +    return [int(x) - 1 for x in input().split()] + + +def LF(): +    return [float(x) for x in input().split()] + + +def LS(): +    return input().split() -def lcm(*numbers): -    return reduce(lcm_base, numbers, 1) +def lcm_list(numbers): +    return functools.reduce(lcm_base, numbers, 1) -l = lcm(*a) -exist = not 0 in ((l // a) % 2) -if exist: -    print(((M // l + 1) // 2)) -else: -    print((0)) +def resolve(): +    N, M = LI() +    a = LI() +    a_half = [i // 2 for i in a] +    a_half_lcm = lcm_list(a_half) +    has_scm = not 0 in [a_half_lcm // i % 2 for i in a_half] +    if has_scm: +        print(((M - a_half_lcm) // (2 * a_half_lcm) + 1)) +    else: +        print((0)) + + +if __name__ == "__main__": +    resolve()