(async () => {
  const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\s/);
  const a = Number(input[0]);
  const b = Number(input[1]);
  const ans = b >= a? a : a - 1;
  console.log(ans);
})();