check if sum of any two elements is in the third