How to choose a good grading curve for yes/no exams?
For this situation, I provide three answer options:

Yes.
No.
I don't know.

The grading rubric is:

Correct answer: +1
Incorrect answer: 0
I don't know: +0.5

That way, if the student really doesn't know, they are guaranteed the expectation of a random guess and you get feedback on holes in student knowledge, which can be used to take remedial action. If your aim is more effective student learning, this can be a good strategy.
I've tried to avoid negative marks for a couple of reasons:

Imagine two candidates who achieve the same final score in a negatively marked exam. One candidate answers only part of the paper, losing a few marks for wrong answers. The other answers almost all of the paper, getting far more correct but also getting several wrong and having marks deducted. Which one knows more?
The second problem is that the use of negative marking extends the theoretical range of marks for the exam. For example, if one mark is awarded for every correct answer and one deducted for each wrong answer, the theoretical range of the exam is - 100 to +100 per cent.

—
From the comments moved to chat: someone asked about a slightly different value for the “I don’t know” option. This is my response:
I tend not to use Yes/No questions, but multiple choice for some assessment. In those cases, I make the &quot;I don't know&quot; option worth 1/(N-1) where N is the number of other options. That way, if there are 3 other options, a random guess would expect to get 1/3 but the I don't know option gains 1/2 --- the expected value if the student can knock out one of the three options..