What we actually need is exclusive-OR.