function Main(input){
	var xs = input.trim().split(' ').map(v=>parseInt(v,10));
    if(xs[1] >= xs[0]){
    console.log(xs[0]);
    }else if(xs[1] < xs[0]){
   console.log(xs[0]-1);
    }
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));