You can use COUNTIFS, i.e. in M2 copied across and down

=COUNTIFS($B$2:$B$12,$K2,C$2:C$12,"Yes")