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 = list(map(int, readline().split()))

    A = list(map(int, readline().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()

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 = list(map(int, input().split()))

    A = list(set(map(int, input().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()

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 = list(map(int, readline().split()))
    A = list(map(int, readline().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()

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 = list(map(int, input().split()))
    A = list(set(map(int, input().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, readline().split())) -    A = list(map(int, readline().split())) +    N, M = list(map(int, input().split())) +    A = list(set(map(int, input().split(" "))))