Cyclopentanone is treated with piperidine
As per the reaction sequence what you said about A is absolutely correct and in B I think you didn't consider hydrolysis of the product. The product what you have written is correct before hydrolysis, and after hydrolysis the carbonyl reforms and the other component becomes piperidine again. So,the final product B is 2-(phenylmethyl)cyclopentan-1-one. Hope that helps!