'use strict'
 
function Main(input) {
	const month = input.split(' ')[0];
	const day = input.split(' ')[1];
	if(month <= day){
		console.log(month);
	} else {
		console.log(month - 1);
	}


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