Depo shot

Is the FIRST Depo shot immediately affective if you get it within the first 5 days of your period?