function main(input){
  const a=input.trim().split(' ').map(Number);
  if(a[0]>=a[1]){
    console.log(a[0]);
  }else{
    console.log(a[0]-1);
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
