function main(input) {
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  if(a<=b){
    console.log(a);
  }else{
    console.log(a-1);
  }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));