function main(arg) {
	var arg = arg.split("\n")[0].split(" ")
	var a = Number(arg[0]) 
	var b = Number(arg[1])
	if (b % a === 0) {
		console.log(a + b)
	} else {
		console.log(b - a)
	}
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));