Was I safe?

Me and my boyfriend was having sex my period is due in 18 days and my 2 apps said my ovulation date is July 29. We were using a condom but it broke and we quickly got a plan b and i took it exactly at 11:04 pm. Im currently starting the pill but I’m waiting till my period to come to officially start it ( if that’s make sense) was I safe