lines = readlines.map{|line| line.split(' ').map(&:to_i)}
b=1
for i in 0..lines[0][0]-1 do
  for j in 0..i do
    if lines[1][i]!=lines[1][j] then
      b=b.lcm(lines[1][i]/2)
    end
  end
end
if lines[0][1]>=b then
  if lines[0][1]/b%2==0 then
    puts lines[0][1]/b/2
  else
    puts lines[0][1]/b/2+1
  end
else
  puts 0
end