require 'prime'
N, M = gets.split.map(&:to_i)

factor = M.prime_division
comb = [1]
factor.each do |n, e|
  e.times do |i|
    comb << n**(i+1)
  end
end
comb = comb.combination(2).to_a
p comb

max = 1
comb.each do |i,j|
  if i*j <= M/N && i*j > max
    max = i*j
  end
end
puts max
