You could add a couple of lines to the code, but you also have to lock the spreadsheet and unlock A1 so the user can select between Yes and No.
The code will take care of locking and unlocking A2 based on the choice in A1, but not locking the spreadsheet.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
If Range("A1").Value = "No" Then
Range("A2").Value = 0
Range("A2").Locked = True
Else
Range("A2").Value = ""
Range("A2").Locked = False
End If
End If
End Sub