Can I get pregnant while having sex on period.

Can you get pregnant while having sex on your period??!! My period just ended yesterday and me and my boyfriend had sex. But I'm just curious if you can bc we are trying and nothing seems to work at the moment.