"Unable to verify account name or password" in Mail app despite using correct info
Yahoo has added more security and so does not work with a simple IMAP login by default.

Yahoo's information is here 

I think to use MacOS Mail you need to follow step 3


  While changing or upgrading your third party applications, you can temporarily give them access.
  
  
  Sign in to Yahoo Mail.
  Go to your "Account security" settings.
  Turn on Allow apps that use less secure sign in.
  
  
  Caution - Do not use this setting as a permanent access method. It is intended only for temporary access while you switch or upgrade to a secure application. Remember to turn it off afterwards.