Yeast infection

So I’ve been having sex with my boyfriend , had no symptoms of yeast infection ... but my doctor called me and told me I have a yeast infection. Can men get them as well ?