And she said "yes".

On the other hand, the Immaculate Conception meant she was born without sin, and saying "no" to God is pretty much the definition of sin, so she was kind of hard-coded to say "yes".

Super-technical: God didn't ask, an angel asked, so "no" might have been theoretically possible, except the angel was God's agent...