import java.util.Scanner

import scala.collection.mutable.ArrayBuffer
import scala.util.control.Breaks

object Main {

  def solve(sc: Scanner): String = {
    val (l, r) = (sc.nextLong(), sc.nextLong())

    val br = new Breaks
    val modBuf = ArrayBuffer.empty[Long]
    br.breakable {
      (l to r).foreach { v =>
        val value = v % 2019
        modBuf += value
        if (value == 0) br.break()
      }
    }

    val Array(m1, m2) = modBuf.sorted.take(2).toArray
    (m1 * m2).toString
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val writer = new java.io.PrintWriter(System.out)
    writer.println(solve(sc))
    writer.flush()
  }

  private def debug(x: Any): Unit = {
    if (System.getenv("LOCAL_DEBUG") != null) println(x)
  }
}
