function Main(input) {
	input = input.trim();
  var mae = parseInt(input.split(" ")[0]);
  var ato = parseInt(input.split(" ")[1]);
  var output = mae;
  if(ato < mae){
     output--;
  }
  console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
