Honestly I am sure you already know the answer. It depends on you and the program.
Brigham And Women's Hospital for Internal Medicine will probably automatically reject your application. Ditto for UCSF Dermatology, or Mayo Radiology.
Programs will factor it in based on the specialty competitiveness, your full application, and the program competitiveness.
Is it a negative factor in your application. Absolutely. Is it a fatal factor. Absolutely not. No matter what, it is now part of your permanent record. Work hard on passing the second attempt at the exam and making the rest of your application shine. Then apply broadly.
Best of luck.