function main(input) {
  const arr = input.split(' ');
  const month = parseInt(arr[0]);
  const day = parseInt(arr[1]);

  console.log(day >= month ? month : month - 1);
}

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