I completely shut down the iPhone, restarted and then added the Yahoo account under "other". Now it works... but I can not see what had gone wrong to create this problem.
This is speculation, it's impossible to say for sure, but if it was working OK and suddenly broke it could be because something happened specific to your phone that caused your iPhone to get confused, or there may have been a Yahoo service issue related to the servers that host your account and something about their internal failover and/or account restore process caused enough of a change to your mailbox to confuse your mail programs.