I've found a few possible problems / solutions:
1. keep trying to log in - Yahoo is rubbish and sometimes it just takes lots of attempts
2. Yahoo may have changed the access and privacy settings again. Login with a PC and check your access for 3rd party devices.
3. Your phone may be listed as an approved device but still not working. If so, remove it and then add it again using a unique log-in code that the website provides.
Good luck.