I guess this has more to do with logic than physics . Replace X and Y with electromagnetic fields if you like . Forget about the balls or walls, really.
We agreed that (a)2 objects cannot occuppy the same space at the same time, hence collisions, or interactions. And (b)they can occupy the same...