Save rendered image before compositing without re-rendering
OK, I found it in the meantime. The EXR file of image B actually also contains image A, I just have to switch the "Layer" in the Image input node. I hope in the future this question and answer will still help somebody.