
function Main(input) {
  var L = parseInt(input[0], 10);
  var R = parseInt(input[1], 10);

  var mod = 2019;
  var min = 2019;

  for (var i = L; i < R; i++) {
    for (var j = i + 1; j <= R; j++) {
      var amari = (i * j) % mod;
      min = min > amari ? amari : min;
    }
  }

  console.log(min);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));