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 lcm(a, b):

    ab = a * b

    while b != 0:

        a, b = b, a % b

    return ab // a





def solve(string):

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

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

    l = reduce(lcm, (2 * m + 2 if _a % c or not _a // c % 2 else _a for _a in 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 lcm(a, b):
    ab = a * b
    while b != 0:
        a, b = b, a % b
    return ab // a


def solve(string):
    n, m, *a = list(map(int, string.split()))
    c = 2 ** len(bin(a[0]).split("1")[-1])
    l = reduce(lcm, (2 * m + 2 if _a % c or not _a // c % 2 else _a for _a in 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 -    return a * b // gcd(a, b) +    ab = a * b +    while b != 0: +        a, b = b, a % b +    return ab // a -    l = a[0] -    for _a in a: -        if _a % c or not _a // c % 2: -            return "0" -        l = lcm(l, _a) +    l = reduce(lcm, (2 * m + 2 if _a % c or not _a // c % 2 else _a for _a in a))