Answer pls haha

I just wanna ask if it is safe to have sex on the 5th or any day that is near end your period? We did it with no protection because I know that I'm almost done with my period and i think its safe. That's why I had the courage to do it that time lol. Just wanna make sure. Thank you!!