function Main(input) {
    tmp = input.split(" ");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    if (b < a) {
    	result = a - 1;
    } else {
    	result = a;
    }
    //結果
    console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));