L, R = gets.split.map(&:to_i)

if R - L >= 2018
  puts 0
else
  remainders = []
  (L..R).each do |n|
    remainders << n % 2019
  end

  i, j = remainders.sort.take(2)
  # p "i:#{i} j:#{j}"
  p i*j
end
