first = member AND mask last = first OR (NOT mask)