This may be if you have an old one, but regardless you want to back up.
On your computer go to www.itunes.com
Install itunes and when installed, open it and connect the iPhone to the computer
Then in iTunes, click File > Devices > Back up
Backup the iPhone and when it has finished, disconnect the iPhone
Then go to Settings, General, Reset, Erase all content and reset settings.
Let this complete then setup the iPhone again.
Once setup, then try to add the Yahoo account and let me know if it now adds please
If it does not, then update your firmware if asked, then try again
This will remove firmware as causing this issue, so let me know the results