The bulletin on the website of the beast itself states that the only requirement is that you be enrolled in an accredited medical school or that you have graduated from an accredited medical school. It doesn't list a specific requirement for when you may take it during your four years of medical school.
If you're in a traditional school, and if your last courses are pharmacology or pathology, then I wouldn't recommend you take it months early. If you do, you may have a hard time getting a good score. You may even have a hard time passing.
By the way, you can take step 2 first if you want.