Identify the logic gates X and y

Identify the logic gates X and y shown in the figure. Write down the truth table for output Z for all possible inputs A and B.

X: NAND gate
Y: NOT gate