open System
open System.Collections.Generic

let ReadOne T = stdin.ReadLine()|> T
let ReadSplit T = stdin.ReadLine().Split()|>Array.map T
[<EntryPoint>]
let main argv =
    let a,b=stdin.ReadLine().Split()|>fun c -> int c.[0],int c.[1]
    if b>=a then a else a-1
    |>stdout.WriteLine
    0
