May have something to do with "second-sign in verification" in yahoo mail. Go to your yahoo account info section and click on link "Set up your second sign-in verification" where you will see a section that reads:
Certain apps don't work with Yahoo's second sign-in verification.
They include:
Mail apps like iOS Mail, Android Mail, and Outlook
To use these apps, you'll need to generate an app-specific password, and then enter it in the password field of your app.You'll only have to create and enter the password once for each app.
Click on the link to create this one-time password and use it when you create the yahoo account in your iphone settings.