Sex on your period

Is it ok to have sex or masturbate while you’re on period