You can create NOT by linking the input to the 2 inputs of NAND so it would be a NOT. AND created by using NAND and NOT. Then everything could done