That might be a loaded question because it assumes The Virgin Mary really existed when she might only be a fictional Bible character. If she did exist, I’m quite sure she was a virgin at birth, so, unless she somehow had sex before birth, which is virtually impossible, the answer is yes.
How long she remained a virgin is another question. If she got pregnant, as The Bible claims, it’s highly unlikely she was a virgin when it happened. Without artificial insemination; a modern procedure; the likelihood of a virgin getting pregnant when Mary supposedly lived was even lower.
God impregnanted her spiritually.
Immaculate conception sir.