Writing down logic of a circuit
If you trace through and label the inputs of each AND gate, it makes thing clearer:



W = (NOT B) AND (NOT A), same as NOT (B OR A) by De Morgan
X = (NOT B) AND A
Y = B AND (NOT A)
Z = B AND A