You'll need to do this in two steps. The formula you want, based on your example, is:
Code:
=IF(ISERROR(VLOOKUP(B1,$A$1:$B$7,2,FALSE)),"no","yes")
(see the picture below)
After you enter the formula and copy it into column C for all entries, you'll have yes/no for each line. Now highlight ALL THREE columns, and SORT by column C (see the second part of the pic below). Now all the yes answers are together and you have all the numbers grouped.