import sys



read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60





def gcd(a, b):

    while b:

        a, b = b, a % b

    return a





def lcm(a, b):

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





def main():

    N, M, *A = list(map(int, read().split()))

    B = A.copy()



    while not any(b % 2 for b in B):

        B = [b // 2 for b in B]



    if not all(b % 2 for b in B):

        print((0))

        return



    semi_lcm = 1

    for a in A:

        semi_lcm = lcm(semi_lcm, a // 2)



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

    return





if __name__ == '__main__':

    main()

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



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

G = A.copy()

 

while not any(x % 2 for x in G):

    G = [i // 2 for i in G]

 

if not all(x % 2 for x in G):

    print((0))

    exit(0)

    

def gcd(a, b):

    while b:

        a, b = b, a % b

    return a

    

def lcm(a, b):

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

    

total = 1



for x in A:

    total = lcm(total, x // 2)



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

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def main():
    N, M, *A = list(map(int, read().split()))
    B = A.copy()
    while not any(b % 2 for b in B):
        B = [b // 2 for b in B]
    if not all(b % 2 for b in B):
        print((0))
        return
    semi_lcm = 1
    for a in A:
        semi_lcm = lcm(semi_lcm, a // 2)
    print(((M // semi_lcm + 1) // 2))
    return


if __name__ == "__main__":
    main()

N, M = list(map(int, input().split()))
A = list(set(map(int, input().split(" "))))
G = A.copy()
while not any(x % 2 for x in G):
    G = [i // 2 for i in G]
if not all(x % 2 for x in G):
    print((0))
    exit(0)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


total = 1
for x in A:
    total = lcm(total, x // 2)
print(((M // total + 1) // 2))

-import sys - -read = sys.stdin.read -readline = sys.stdin.readline -readlines = sys.stdin.readlines -sys.setrecursionlimit(10**9) -INF = 1 << 60 +N, M = list(map(int, input().split())) +A = list(set(map(int, input().split(" ")))) +G = A.copy() +while not any(x % 2 for x in G): +    G = [i // 2 for i in G] +if not all(x % 2 for x in G): +    print((0)) +    exit(0) -def main(): -    N, M, *A = list(map(int, read().split())) -    B = A.copy() -    while not any(b % 2 for b in B): -        B = [b // 2 for b in B] -    if not all(b % 2 for b in B): -        print((0)) -        return -    semi_lcm = 1 -    for a in A: -        semi_lcm = lcm(semi_lcm, a // 2) -    print(((M // semi_lcm + 1) // 2)) -    return - - -if __name__ == "__main__": -    main() +total = 1 +for x in A: +    total = lcm(total, x // 2) +print(((M // total + 1) // 2))