from fractions import gcd

from functools import reduce





def lcm(a, b):

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





def count(n):

    c = 0

    while n % 2 == 0:

        c += 1

        n //= 2

    return c





def solve(string):

    n, m, *a = list(map(int, string.split()))

    c = len(bin(a[0]).split("1")[-1])

    for _a in a:

        if count(_a) != c:

            return "0"

    l = reduce(lcm, a)

    return str(max((m - l // 2) // l + 1, 0))





if __name__ == '__main__':

    import sys

    print((solve(sys.stdin.read().strip())))

from fractions import gcd





def lcm(a, b):

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





def solve(string):

    n, m, *a = list(map(int, string.split()))

    c = 2**len(bin(a[0]).split("1")[-1])

    l = a[0]

    for _a in a:

        if _a % c or not _a // c % 2:

            return "0"

        l = lcm(l, _a)

    return str(max((m - l // 2) // l + 1, 0))





if __name__ == '__main__':

    import sys

    print((solve(sys.stdin.read().strip())))

from fractions import gcd
from functools import reduce


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


def count(n):
    c = 0
    while n % 2 == 0:
        c += 1
        n //= 2
    return c


def solve(string):
    n, m, *a = list(map(int, string.split()))
    c = len(bin(a[0]).split("1")[-1])
    for _a in a:
        if count(_a) != c:
            return "0"
    l = reduce(lcm, a)
    return str(max((m - l // 2) // l + 1, 0))


if __name__ == "__main__":
    import sys

    print((solve(sys.stdin.read().strip())))

from fractions import gcd


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


def solve(string):
    n, m, *a = list(map(int, string.split()))
    c = 2 ** len(bin(a[0]).split("1")[-1])
    l = a[0]
    for _a in a:
        if _a % c or not _a // c % 2:
            return "0"
        l = lcm(l, _a)
    return str(max((m - l // 2) // l + 1, 0))


if __name__ == "__main__":
    import sys

    print((solve(sys.stdin.read().strip())))

-from functools import reduce -def count(n): -    c = 0 -    while n % 2 == 0: -        c += 1 -        n //= 2 -    return c - - -    c = len(bin(a[0]).split("1")[-1]) +    c = 2 ** len(bin(a[0]).split("1")[-1]) +    l = a[0] -        if count(_a) != c: +        if _a % c or not _a // c % 2: -    l = reduce(lcm, a) +        l = lcm(l, _a)