The combination of NAND gates shown here under equivalent to - gate
AND gate
OR gate
NOT gate
NAND gate
the outpput x after A and B is A. B and is equal to A+B according to De Morgan's theorem final output y is equal to A+B=A+B