Your password should work into the safe mode but if it is not working then follow these steps.
1. Restart your PC.
2. When you reach the sign-in screen, press and hold the Shift key and click on the Power button, and then click Restart.
3. After your PC restarts, select Troubleshoot > Advanced options >Startup settings > Restart.
4. After your PC restarts, you should see a number of options. Press 5 or F5 for Safe Mode with networking.
5. When you reach login screen, press Windows + U and select the On-Screen Keyboard from the Ease of Access list. or click on Ease of Access at bottom right and click On-Screen Keyboard from the list.
6. Then use your cursor to type the password with On-Screen Keyboard. Before clicking the login, press the eye symbol (I.e. Reveal Password) option in the password field, to see the password is correct.
Let me know if it is working for you.