maybe this...
=if(AND(OR(A1="ABC",A1="DEF"),B2="no"),A2,"")