A NAND gate is a combination of an AND gate followed by a NOT gate (inverter).
The NAND (Not AND) gate gives an output that is the inverse of the output of an AND gate.
Mathematically:
\[
A \, \text{NAND} \, B = \overline{A \cdot B}
\]
So, first the inputs are passed through an AND gate and the result is then inverted.