Using VTSACK()
Function,

Formula used in cell E2
=UNIQUE(VSTACK(A2:A7,C2:C7))
Please note VSTACK() Function currently available in O365 Insiders Beta Channel Version, arrays can be non-contiguous irregular but needs to be vertical.
Also since you have non-contiguous ranges, TEXTJOIN()
can also perform the same by wrapping it within FILTERXML()
Function.
Formula used in cell F2
=UNIQUE(FILTERXML("<t><s>"&TEXTJOIN("</s><s>",,A2:A7,C2:C7)&"</s></t>","//s"))
Note: Since you have not mentioned your Excel Version, assumption made that you are using O365 - updated version.