import scala.io.Source

object Main extends App {
  val lines: Iterator[String] = Source.stdin.getLines()
  val line = lines.next.split(" ").map(_.toInt).take(2)
  val a = line.head
  val b = line(1)

  println((if (b >= a) a else a - 1).toString)
}
