Imagine you are about to buy a new phone and ask, “Does the phone support 4G connection?” You could anticipate the answer and immediately ask a follow-up question, like “If so, do you also offer 4G data plans?” or “If not, what’s the fastest Internet speed it can reach?”
In many European languages, you would literally ask “If yes, do you …?” and “If no, what’s the …?” instead. However, this is not the common way to form such follow-up questions in English. In most contexts, “If yes, …” and “If no, …” would be considered unnatural by most native speakers.
There are a few specialized cases in which “If yes” and “If no” may appear, such as in a manual:
If NO, remove the disk and repeat the action.
or in a questionnaire:
In such cases, the words “yes” and “no” would typically be capitalized, set in bold, or otherwise distinguished from the rest of the text. Unless you are writing a manual or a questionnaire, “If so” and “If not” are the safer option.