Sex while pregnant

I had a miscarriage at 12weeks about last year.. today I found out I am pregnant. Is it safe for me to still have sex?