Make a keras layer with two disconnected parts

Hello.
I’d like to make a neuronal network with the first two layers of sizes 2n and 2m respectively;
I want the first n neurones of the first layer to be densely connected with the m neurones of the second,
and the n last densely connected with the m last. It would look like two neuronal networks in parallel.

I found no core keras.layers working and I really don’t understand how does the custom layers work. What should I do ?