input = gets.split.map(&:to_i)
k = input[0]
kazu = 0
ans=[]
subb=[]

if input[1] - input[0] > 2020 then
  print 0
elsif input[1] - input[0] > 674
while k <= input[1] and (k-input[0]) <=2030 do
  ans.push(k%2019)
  subb.push(k%673)
  k += 1
end
  ans.sort!
  subb.sort!
  if subb[0] == 0 then
    print 0
  else
    print ans[0] * ans[1]
  end

else
  while k <= input[1] and (k-input[0]) <=2030 do
    ans.push(k%2019)
    k += 1
  end
ans.sort!
subb.sort!
print ans[0] * ans[1]
end