Is Plan B effective?

say a guy doesnt wear a condom and cums inside you, would plan B DEFINITELY prevent pregnancy?