Public Class Compiler
    Shared Sub Main()
        Const c As Integer = 2019
        Dim input As String() = Console.ReadLine().Split(" ")
        Dim l As Integer = Integer.Parse(input(0))
        Dim r As Integer = Integer.Parse(input(1))
        Dim output As Integer = c
        If r - l < c Then
            For i As Integer = l To r
                For j As Integer = i + 1 To r
                    output = Math.Min(((i Mod c) * (j Mod c)) Mod c, output)
                Next
                If output = 0 Then Exit For
            Next
        End If
        output = output Mod c
        Console.WriteLine(output)
    End Sub
End Class