You need to change the cable between A and B from a 14/2 to a 14/3.
Then connect light B to the red wire. Leave the two black wires connect to each other but not to light B.
Connect the red wire at light A to the black on light A fixture.
Then connect light B to the red wire. Leave the two black wires connect to each other but not to light B.
Connect the red wire at light A to the black on light A fixture.