If the columns are A and B enter this formula in column C and copy down the length of your data. Then, sort all the zeros to the top

Formula: copy to clipboard
=IF(COUNTIF(B:B,A1)>0,1,0)