n,m = list(map(int,input().split()))

a = list(map(int,input().split()))

cnt = 0

while True:

  if a[0] % 2 == 0:

    a[0] //= 2

    cnt += 1

  else:

    break

div = 2 ** cnt

if div != 1:

  m //= (div//2)

for i in range(1,n):

  if a[i] % div == 0:

    a[i] //= div

    if a[i] % 2 == 0:

      print((0))

      break

  else:

    print((0))

    break

  if cnt == 0:

    print((0))

    break

else:

  #print(a)

  lcm = a[0]

  for i in range(1,n):

    big,sml = a[i],lcm

    while sml != 0:

      big,sml = sml,big%sml

    lcm *= a[i] // big

  #print(lcm)

  ans = m // (2*lcm)

  #print(ans)

  if m % (2*lcm) >= lcm:

    ans += 1

  print(ans)
n,m = list(map(int,input().split()))

a = list(map(int,input().split()))

b = 1

while a[0] % 2 == 0:

  a[0] //= 2

  b *= 2

if b == 0:

  print((0))

else:

  for i in range(1,n):

    a[i] //= b

    if a[i] % 2 == 0:

      print((0))

      break

  else:

    m //= b//2

    lcm = a[0]

    for i in range(1,n):

      big,sml = lcm,a[i]

      while sml != 0:

        big,sml = sml,big%sml

      lcm *= a[i] // big

      if lcm > m:

        print((0))

        break

    else:

      m -= lcm

      ans = 1

      lcm *= 2

      ans += m // lcm

      print(ans)
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
while True:
    if a[0] % 2 == 0:
        a[0] //= 2
        cnt += 1
    else:
        break
div = 2**cnt
if div != 1:
    m //= div // 2
for i in range(1, n):
    if a[i] % div == 0:
        a[i] //= div
        if a[i] % 2 == 0:
            print((0))
            break
    else:
        print((0))
        break
    if cnt == 0:
        print((0))
        break
else:
    # print(a)
    lcm = a[0]
    for i in range(1, n):
        big, sml = a[i], lcm
        while sml != 0:
            big, sml = sml, big % sml
        lcm *= a[i] // big
    # print(lcm)
    ans = m // (2 * lcm)
    # print(ans)
    if m % (2 * lcm) >= lcm:
        ans += 1
    print(ans)

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = 1
while a[0] % 2 == 0:
    a[0] //= 2
    b *= 2
if b == 0:
    print((0))
else:
    for i in range(1, n):
        a[i] //= b
        if a[i] % 2 == 0:
            print((0))
            break
    else:
        m //= b // 2
        lcm = a[0]
        for i in range(1, n):
            big, sml = lcm, a[i]
            while sml != 0:
                big, sml = sml, big % sml
            lcm *= a[i] // big
            if lcm > m:
                print((0))
                break
        else:
            m -= lcm
            ans = 1
            lcm *= 2
            ans += m // lcm
            print(ans)

-cnt = 0 -while True: -    if a[0] % 2 == 0: -        a[0] //= 2 -        cnt += 1 -    else: -        break -div = 2**cnt -if div != 1: -    m //= div // 2 -for i in range(1, n): -    if a[i] % div == 0: -        a[i] //= div +b = 1 +while a[0] % 2 == 0: +    a[0] //= 2 +    b *= 2 +if b == 0: +    print((0)) +else: +    for i in range(1, n): +        a[i] //= b -        print((0)) -        break -    if cnt == 0: -        print((0)) -        break -else: -    # print(a) -    lcm = a[0] -    for i in range(1, n): -        big, sml = a[i], lcm -        while sml != 0: -            big, sml = sml, big % sml -        lcm *= a[i] // big -    # print(lcm) -    ans = m // (2 * lcm) -    # print(ans) -    if m % (2 * lcm) >= lcm: -        ans += 1 -    print(ans) +        m //= b // 2 +        lcm = a[0] +        for i in range(1, n): +            big, sml = lcm, a[i] +            while sml != 0: +                big, sml = sml, big % sml +            lcm *= a[i] // big +            if lcm > m: +                print((0)) +                break +        else: +            m -= lcm +            ans = 1 +            lcm *= 2 +            ans += m // lcm +            print(ans)