import sys



sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

p2D = lambda x: print(*x, sep="\n")

def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]



def gcd(x,y):

    while y:x,y=y,x%y

    return x



def lcm(x,y):

    g=gcd(x,y)

    return x*y//g



def main():

    n,m=MI()

    aa=LI()

    aa=[a>>1 for a in aa]

    l=1

    for a in aa:l=lcm(l,a)

    for a in aa:

        if l//a%2==0:

            print(0)

            exit()

    print((m//l+1)//2)



main()

from itertools import permutations

import sys



sys.setrecursionlimit(10 ** 6)

from bisect import *

from collections import *

from heapq import *



def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def SI(): return sys.stdin.readline()[:-1]

def LLI(rows_number): return [LI() for _ in range(rows_number)]

int1 = lambda x: int(x) - 1

def MI1(): return map(int1, sys.stdin.readline().split())

def LI1(): return list(map(int1, sys.stdin.readline().split()))

p2D = lambda x: print(*x, sep="\n")

dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]



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,k=MI()

    aa=LI()

    aa2=[a//2 for a in aa]

    l=1

    for a2 in aa2:l=lcm(l,a2)

    for a2 in aa2:

        if l//a2%2==0:

            print(0)

            exit()

    print((k//l+1)//2)



main()

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number):
    return [LI() for _ in range(rows_number)]


def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


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


def main():
    n, m = MI()
    aa = LI()
    aa = [a >> 1 for a in aa]
    l = 1
    for a in aa:
        l = lcm(l, a)
    for a in aa:
        if l // a % 2 == 0:
            print(0)
            exit()
    print((m // l + 1) // 2)


main()

from itertools import permutations
import sys

sys.setrecursionlimit(10**6)
from bisect import *
from collections import *
from heapq import *


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def SI():
    return sys.stdin.readline()[:-1]


def LLI(rows_number):
    return [LI() for _ in range(rows_number)]


int1 = lambda x: int(x) - 1


def MI1():
    return map(int1, sys.stdin.readline().split())


def LI1():
    return list(map(int1, sys.stdin.readline().split()))


p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]


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, k = MI()
    aa = LI()
    aa2 = [a // 2 for a in aa]
    l = 1
    for a2 in aa2:
        l = lcm(l, a2)
    for a2 in aa2:
        if l // a2 % 2 == 0:
            print(0)
            exit()
    print((k // l + 1) // 2)


main()

+from itertools import permutations -int1 = lambda x: int(x) - 1 -p2D = lambda x: print(*x, sep="\n") +from bisect import * +from collections import * +from heapq import * +def SI(): +    return sys.stdin.readline()[:-1] + + -def gcd(x, y): -    while y: -        x, y = y, x % y -    return x +int1 = lambda x: int(x) - 1 -def lcm(x, y): -    g = gcd(x, y) -    return x * y // g +def MI1(): +    return map(int1, sys.stdin.readline().split()) + + +def LI1(): +    return list(map(int1, sys.stdin.readline().split())) + + +p2D = lambda x: print(*x, sep="\n") +dij = [(1, 0), (0, 1), (-1, 0), (0, -1)] + + +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 = MI() +    n, k = MI() -    aa = [a >> 1 for a in aa] +    aa2 = [a // 2 for a in aa] -    for a in aa: -        l = lcm(l, a) -    for a in aa: -        if l // a % 2 == 0: +    for a2 in aa2: +        l = lcm(l, a2) +    for a2 in aa2: +        if l // a2 % 2 == 0: -    print((m // l + 1) // 2) +    print((k // l + 1) // 2)