How can I get text in one cell to change to a number in another cell?

IE: Cell a1 = yes/no ,
Then I want cell b2 to read 1 if answer in a1 is yes and if anwer is no in a1 read 0 in b2 also.

Thanks

Kathi