import Control.Applicative
import Data.List

main = do
  [l, r] <- (map read).words <$> getLine :: IO [Int]
  --let l = 2020
  --let r = 2040
  print $ product $ take 2 $ sort $ map (`mod` 2019) [l..r]
