Plan b

Ok so I just had sex and he didn't pull out like he was supposed to, can my Dr prescribe me plan b or do I just go to the store and buy it ? I live in Washington state