is it safe to have sex while on period?

me and my bf just had sex while i'm on my period. Is it safe?:/