import sys

from fractions import gcd



read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60





def lcm(x, y):

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





def main():

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

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

    A = [a // 2 for a in A]

    semi_lcm = 1

    for a in A:

        semi_lcm = lcm(semi_lcm, a)

        if semi_lcm > M:

            print((0))

            return



    for a in A:

        if semi_lcm // a % 2 == 0:

            print((0))

            return



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

    return





if __name__ == '__main__':

    main()

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()))

    A = list(set(A))

    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()

import sys
from fractions import gcd

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


def lcm(x, y):
    return x * y // gcd(x, y)


def main():
    N, M = list(map(int, input().split()))
    A = list(set(map(int, input().split(" "))))
    A = [a // 2 for a in A]
    semi_lcm = 1
    for a in A:
        semi_lcm = lcm(semi_lcm, a)
        if semi_lcm > M:
            print((0))
            return
    for a in A:
        if semi_lcm // a % 2 == 0:
            print((0))
            return
    print(((M // semi_lcm + 1) // 2))
    return


if __name__ == "__main__":
    main()

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()))
    A = list(set(A))
    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()

-from fractions import gcd -def lcm(x, y): -    return x * y // gcd(x, y) +def gcd(a, b): +    while b: +        a, b = b, a % b +    return a + + +def lcm(a, b): +    return a * b // gcd(a, b) -    N, M = list(map(int, input().split())) -    A = list(set(map(int, input().split(" ")))) -    A = [a // 2 for a in A] +    N, M, *A = list(map(int, read().split())) +    A = list(set(A)) +    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 = lcm(semi_lcm, a) -        if semi_lcm > M: -            print((0)) -            return -    for a in A: -        if semi_lcm // a % 2 == 0: -            print((0)) -            return +        semi_lcm = lcm(semi_lcm, a // 2)