#abc150d. [abc150_d]Semi Common Multiple

[abc150_d]Semi Common Multiple

Problem Statement

Given are a sequence A=a1,a2,......aNA= {a_1,a_2,......a_N} of NN positive even numbers, and an integer MM.

Let a semi-common multiple of AA be a positive integer XX that satisfies the following condition for every kk (1leqkleqN)(1 \\leq k \\leq N):

  • There exists a non-negative integer pp such that X=aktimes(p+0.5)X= a_k \\times (p+0.5).

Find the number of semi-common multiples of AA among the integers between 11 and MM (inclusive).

Constraints

  • 1leqNleq1051 \\leq N \\leq 10^5
  • 1leqMleq1091 \\leq M \\leq 10^9
  • 2leqaileq1092 \\leq a_i \\leq 10^9
  • aia_i is an even number.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM a1a_1 a2a_2 ...... aNa_N

Output

Print the number of semi-common multiples of AA among the integers between 11 and MM (inclusive).


Sample Input 1

2 50
6 10

Sample Output 1

2
  • 15=6times2.515 = 6 \\times 2.5
  • 15=10times1.515 = 10 \\times 1.5
  • 45=6times7.545 = 6 \\times 7.5
  • 45=10times4.545 = 10 \\times 4.5

Thus, 1515 and 4545 are semi-common multiples of AA. There are no other semi-common multiples of AA between 11 and 5050, so the answer is 22.


Sample Input 2

3 100
14 22 40

Sample Output 2

0

The answer can be 00.


Sample Input 3

5 1000000000
6 6 2 6 2

Sample Output 3

166666667