Skip assign controller to player one only when more than 1 gamepad os connected.

Hi!
I’m making a game with local split screen multiplayer, and I want player 1 the work with keyboard if there is only one controller, but if there are two gamepads connected I want one pad for each player (only a 2 player game)
How would I go about this?

Basically I only want to skip assigning gamepad to player 1 when there is only one gamepad connected, but I cant figure out how to do it.

Thanks!