Yoast SEO Redirect Creation tool will allow you to generates the code you need to manually add to your site’s .htaccess file to redirect all the posts to the new /%postname%/ structure.
Enter your site URL, Your old permalink structure and click generate redirect on SEO tool website page. Add generated code to top of your .htaccess
Your Redirects Rule should be:
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ YOUR-DOMAIN/$3