IMAP stopped working after enabling 2 factor authentication

IMAP stopped working after enabling 2 factor authentication

IMAP stopped working after enabling 2 factor authentication. Is there any solution for this?