function Main(input){
    a=input.split(" ");
    if(Number(a[1])%Number(a[0])==0)console.log(Number(a[0])+Number(a[1]));
    else console.log(Number(a[1])-Number(a[0]));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));