I would like to sum based on multiple selection criteria that are look-ups to another tab.

For example, I want to calculate the sum of column c (in sheet1) where column A matches a value in column A in sheet2, and where column B = "yes". The result in the below example would be 10.

sheet1:
x yes 1
x yes 2
x no 3
x no 4
y yes 5
y no 6
z yes 7
z no 8

sheet2:
x
z

Thanks in advance for any help that you can provide!