joins with "could be blank" conditions
Try this:

select emp.*, loc.*    
from employee as emp
  inner join location as loc
    on emp.locationId = loc.id 
where not exists
      ( select *
        from location_flag as lf1 
        where lf1.locationId = loc.id
          and lf1.flag_id = 1
          and lf1.value &lt;&gt; 'YES' 
      )
  and not exists
      ( select *
        from location_flag as lf2 
        where lf2.locationId = loc.id
          and lf2.flag_id = 2
          and lf2.value &lt;&gt; 'YES' 
      ) ;