a,b = gets.chomp.split(" ").map(&:to_i)
numbers = gets.split(" ").map(&:to_i)
i = 0
array = []
list = [0,0]
while list.any? {|w| w <= b }
  	list = []
    array << numbers.map{ |x| x * (0.5+i) }
  	list  << numbers.map{ |x| x * (0.5+i) }
  	array = array.flatten
  	list = list.flatten
  	i += 1
end
array = array.sort
deplication = []
m = 0
j = 0
array.each do |n|
  if n == m
    j += 1
  else
    deplication << j
    j = 0
  end
  m = n
end
p deplication.count(a-1)
