Try this
var y = prompt("Do you want to enter values, type 'Yes' or 'No'!");
while (y.toUpperCase()!="NO")
{
if (y.toUpperCase()=="YES")
{
alert(y);
break;
}
else
{
alert("You have typed \"" +y+ "\" which is not an option! Please type again");
y = prompt("Do you want to enter values, type 'Yes' or 'No'!");
}
}