function Main(input) {
	input = input.split(" ");
	var a = input[0];
	var b = input[1];
	var ret = 0;
	if(a == b || a < b){
		ret = a;
	} else if (a > b) {
		ret = a - 1;
	}
	console.log(ret);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
