Would it still be effective ?

Can you take the pill at night, have sex, and then the next morning have unprotected sex again