Masterbating during pregnancy!

Hi I am 29weeks pregnant. With the second. My sex drive is up on the roof these days. Wondering is it ok to do masterbating or sex? With my first I didn't want hubby to come near me. And no sex drive. But this is completely opposite. 😬 Let me know is it safe!