# -*- coding: utf-8 -*-

import bisect

import heapq

import math

import random

import sys

from collections import Counter, defaultdict, deque

from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal

from functools import lru_cache, reduce

from itertools import combinations, combinations_with_replacement, product, permutations

from operator import add, mul, sub

from fractions import gcd



sys.setrecursionlimit(100000)

input = sys.stdin.readline

INF = 2**62-1





def read_int():

    return int(input())





def read_int_n():

    return list(map(int, input().split()))





def read_float():

    return float(input())





def read_float_n():

    return list(map(float, input().split()))





def read_str():

    return input().strip()





def read_str_n():

    return list(map(str, input().split()))





def error_print(*args):

    print(*args, file=sys.stderr)





def mt(f):

    import time



    def wrap(*args, **kwargs):

        s = time.time()

        ret = f(*args, **kwargs)

        e = time.time()



        error_print(e - s, 'sec')

        return ret



    return wrap





# @mt

def slv(N, M, A):

    b = []

    for a in A:

        c = 0

        while a % 2 == 0:

            c += 1

            a //= 2

        b.append(c)

    if not all(map(lambda x: x==b[0], b)):

        return 0



    d = reduce(lambda x, y: x * y//gcd(x, y), A)

    ans = 0

    if M - d//2 >= 0:

        ans = (M-d//2) // d

    if d // 2 <= M:

        ans += 1



    return ans



def main():

    N, M = read_int_n()

    A = read_int_n()

    print(slv(N, M, A))



if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-

import bisect

import heapq

import math

import random

from collections import Counter, defaultdict, deque

from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal

from functools import lru_cache, reduce

from itertools import combinations, combinations_with_replacement, product, permutations

from operator import add, mul, sub





import sys

# sys.setrecursionlimit(10**6)

# buff_readline = sys.stdin.buffer.readline

buff_readline = sys.stdin.readline

readline = sys.stdin.readline



INF = 2**62-1





def read_int():

    return int(buff_readline())





def read_int_n():

    return list(map(int, buff_readline().split()))





def read_float():

    return float(buff_readline())





def read_float_n():

    return list(map(float, buff_readline().split()))





def read_str():

    return readline().strip()





def read_str_n():

    return readline().strip().split()



def error_print(*args):

    print(*args, file=sys.stderr)





def mt(f):

    import time



    def wrap(*args, **kwargs):

        s = time.time()

        ret = f(*args, **kwargs)

        e = time.time()



        error_print(e - s, 'sec')

        return ret



    return wrap





@mt

def slv(N, M, A):

    b_lcm = 1





    d2 = set()

    for a in A:

        b = a // 2

        b_lcm = b_lcm//math.gcd(b_lcm, b) * b

        for i in range(100000000):

            if a % 2 == 0:

                a //= 2

            else:

                d2.add(i)

                break



    return -(-(M // b_lcm)//2) if len(d2) == 1 else 0











def main():

    N, M = read_int_n()

    A = read_int_n()

    print(slv(N, M, A))





if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
from fractions import gcd

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62 - 1


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
        error_print(e - s, "sec")
        return ret

    return wrap


# @mt
def slv(N, M, A):
    b = []
    for a in A:
        c = 0
        while a % 2 == 0:
            c += 1
            a //= 2
        b.append(c)
    if not all(map(lambda x: x == b[0], b)):
        return 0
    d = reduce(lambda x, y: x * y // gcd(x, y), A)
    ans = 0
    if M - d // 2 >= 0:
        ans = (M - d // 2) // d
    if d // 2 <= M:
        ans += 1
    return ans


def main():
    N, M = read_int_n()
    A = read_int_n()
    print(slv(N, M, A))


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
import sys

# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline
INF = 2**62 - 1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
        error_print(e - s, "sec")
        return ret

    return wrap


@mt
def slv(N, M, A):
    b_lcm = 1
    d2 = set()
    for a in A:
        b = a // 2
        b_lcm = b_lcm // math.gcd(b_lcm, b) * b
        for i in range(100000000):
            if a % 2 == 0:
                a //= 2
            else:
                d2.add(i)
                break
    return -(-(M // b_lcm) // 2) if len(d2) == 1 else 0


def main():
    N, M = read_int_n()
    A = read_int_n()
    print(slv(N, M, A))


if __name__ == "__main__":
    main()

-import sys -from fractions import gcd +import sys -sys.setrecursionlimit(100000) -input = sys.stdin.readline +# sys.setrecursionlimit(10**6) +# buff_readline = sys.stdin.buffer.readline +buff_readline = sys.stdin.readline +readline = sys.stdin.readline -    return int(input()) +    return int(buff_readline()) -    return list(map(int, input().split())) +    return list(map(int, buff_readline().split())) -    return float(input()) +    return float(buff_readline()) -    return list(map(float, input().split())) +    return list(map(float, buff_readline().split())) -    return input().strip() +    return readline().strip() -    return list(map(str, input().split())) +    return readline().strip().split() -# @mt +@mt -    b = [] +    b_lcm = 1 +    d2 = set() -        c = 0 -        while a % 2 == 0: -            c += 1 -            a //= 2 -        b.append(c) -    if not all(map(lambda x: x == b[0], b)): -        return 0 -    d = reduce(lambda x, y: x * y // gcd(x, y), A) -    ans = 0 -    if M - d // 2 >= 0: -        ans = (M - d // 2) // d -    if d // 2 <= M: -        ans += 1 -    return ans +        b = a // 2 +        b_lcm = b_lcm // math.gcd(b_lcm, b) * b +        for i in range(100000000): +            if a % 2 == 0: +                a //= 2 +            else: +                d2.add(i) +                break +    return -(-(M // b_lcm) // 2) if len(d2) == 1 else 0