Two implementations of NAND neural network