Here, try this in B2 (according to AA example):

=IF(A2="","", IF(COUNTIF($D$2:$I$28, LEFT(A2,4)&"*")>0,"yes","no"))