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

def solve
  if (R - L) > 2019
    p 0
    return
  end

  mods = []
  L.upto(R).each do |i|
    mod = i % 2019
    mods << mod
  end

  # p [L, R]
  # p mods

  mods.sort!
  # p mods[0]
  # p mods[1]

  p mods[0] * mods[1]
end

solve