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

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





def main():

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

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



    power = 1

    while all(a % 2 == 0 for a in A):

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

        power *= 2



    if any(a % 2 == 0 for a in A):

        print((0))

        return



    l = 1

    for a in A:

        l = lcm(l, a)

        if l > M:

            print((0))

            return



    l *= power

    ans = (M + l) // (2 * l)

    print(ans)

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

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





def main():

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

    A = list({a // 2 for a in A})



    power = 1

    while all(a % 2 == 0 for a in A):

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

        power *= 2



    if any(a % 2 == 0 for a in A):

        print((0))

        return



    l = 1

    for a in A:

        l = lcm(l, a)

        if l > M:

            print((0))

            return



    l *= power

    ans = (M + l) // (2 * l)

    print(ans)

    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(a, b):
    return a // gcd(a, b) * b


def main():
    N, M, *A = list(map(int, read().split()))
    A = [a // 2 for a in A]
    power = 1
    while all(a % 2 == 0 for a in A):
        A = [a // 2 for a in A]
        power *= 2
    if any(a % 2 == 0 for a in A):
        print((0))
        return
    l = 1
    for a in A:
        l = lcm(l, a)
        if l > M:
            print((0))
            return
    l *= power
    ans = (M + l) // (2 * l)
    print(ans)
    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(a, b):
    return a * b // gcd(a, b)


def main():
    N, M, *A = list(map(int, read().split()))
    A = list({a // 2 for a in A})
    power = 1
    while all(a % 2 == 0 for a in A):
        A = [a // 2 for a in A]
        power *= 2
    if any(a % 2 == 0 for a in A):
        print((0))
        return
    l = 1
    for a in A:
        l = lcm(l, a)
        if l > M:
            print((0))
            return
    l *= power
    ans = (M + l) // (2 * l)
    print(ans)
    return


if __name__ == "__main__":
    main()

-    return a // gcd(a, b) * b +    return a * b // gcd(a, b) -    A = [a // 2 for a in A] +    A = list({a // 2 for a in A})