One of the relays gives you "A and B". The other gives you "A and not B". "A and not B" with A = 1 is just "not B".