Yes you can do this you will lose some stuff in rounding errors and dynamic range. just subtract the image from the background. Tough it does not seem like your operation is add. its possibly add plus a channel normalization. But yes i can reverse this by subtracting the mask and re normalizing the levels.
Image 2:B-d + Normalized levels
I lose some color dynamic but that's all. Whether or not that is too much or too little deepens on picture. Could i do it in opposite direction so B-A. i could but the dynamic range is already pretty weak
Image 2: Inverse A at 36% + B
Please note: I am only able to do these operations because i know what the images were and can search them.