i had this problem till just now. the problem is yahoo updated its securety and less secure app like the ios mail app need permission if you have recently been notified by yahoo to change your password. heres is what you do:
1. log into your yahoo acct.
2. mouse over your name plate when the pop up menu appears click "account info"
3. on the account info page click on the account security tab.
4. scroll down to see "Allow apps that use less secure sign in" option and turn it on it should change blue.
5. go ahead into the ios mail app or into mail setting and add your accounts if you have deleted them and log in like normal. you should be all set.
this has solved my issue on my Iphone4