The major products Y and Z in the following reaction sequence are 

Formation of (Y) (Michael / aza-Michael additions)
Aniline adds to ethyl acrylate in the presence of base \(EtO^{-}\). Because acrylate is in excess, the aniline nitrogen undergoes two conjugate (aza-Michael) additions to give the tertiary amine shown in option B:
\[\begin{aligned} \mathrm{PhNH_2} + 2\ \mathrm{CH_2=CH-CO_2Et} &\xrightarrow[\ \mathrm{H_3O^+}\ ]{\mathrm{EtO^-}} \mathrm{PhN\bigl( CH_2CH_2CO_2Et \bigr)_2} \end{aligned}\]
This is the structure labelled (Y) in option B (i.e. \( \mathrm{N-(2-ethoxycarbonylethyl)_2phenyl} ) amine\). Options A and C are mono-addition products; D has the same connectivity as B but the depicted ring-closure product (see next step) does not match.
Conversion of (Y) → (Z) (saponification, intramolecular cyclization → lactam)
Treatment with NaOH hydrolyses the two ester groups to the corresponding di-carboxylate/di-acid:
\[\mathrm{PhN\bigl( CH_2CH_2CO_2Et \bigr)_2} \xrightarrow{\mathrm{NaOH} \, ,\, \mathrm{H_3O^+},\ \Delta} \mathrm{PhN\bigl( CH_2CH_2CO_2H \bigr)_2}\]
Under heating the diacid (or its activated derivative) can undergo intramolecular condensation/cyclization (a ring closure that builds a six-membered ring containing the nitrogen) followed by loss of water/CO\(_2\) equivalents as needed to give the piperidin-2-one framework with (N)-phenyl substitution:
\[\mathrm{PhN\bigl( CH_2CH_2CO_2H \bigr)_2} \xrightarrow{\Delta} \mathrm{N-phenyl\,piperidin-2-one}\quad (=Z)\]
That is the product shown as (Z) in option B (a six-membered lactam, N-phenylpiperidinone).
Therefore the correct choice is
\[\boxed{\text{(B)}}\]