Is it safe to have sex?

This is a random though but can you have sex when you’re pregnant?

There’s no danger to the baby is there.