function Main(input){
	input=input.split(/\n|\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	
	ans=input[0];
	if(input[0]>input[1]){ans--;}
	
	console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

