No, the YubiKey does not need to stay plugged in continuously. You only need to plug it in when you are performing an authentication action. Once the authentication is complete, you can safely remove the YubiKey from the device.