Here is a circuit with two latches. A simpler solution probably exists as well
simulate this circuit – Schematic created using CircuitLab
Here is a circuit with two latches. A simpler solution probably exists as well
simulate this circuit – Schematic created using CircuitLab