Custom code - make a textbox appear if a customer choose a specific variant

Hi guys,

The company who built my website left me with no answers, and decided to disappear after the final payment. Good for me.
I have no knowledge in code and this left me in need of your help.
I have this line of code:

This line basically says (although you probably know better than me) that if I have the word ‘YES’ in one of my variants, a text box appears, and it’s mandatory for the customer to type text in it before they can add to cart, otherwise they get an error message. This is good, this is what I need.

The problem is, I want the customers to also be able to choose ‘NO’ and allow them to add to cart without typing any text. So I’m adding the value NO to the variant list, but STILL, even if they choose NO… It’s still giving them the error message.
I need the error message (or even better - the text box itself) to appear only when they choose yes. Otherwise, whatever value (in this case ‘NO’), I don’t want anything special to happen, just allow them to add to cart.

Any ideas?

Thank you so much!