Planning and IUD

I’ve had my IUD in for 5 days and in the heat of the moment he didn’t wear a condom and pulled out but not sure if all the way, I was going to take plan b...is that safe?? To take plan b with an IUD in?