Do you have to have sex to get pregnant

Do you have to have sex to get pregnant?