What muscles do you contract to signify yes and no?
Skeletal muscles work in pairs, with one muscle relaxing as another contracts. To signify yes, you would nod, alternating moving the head forward while lowering the chin, and raising the head and chin. To lower the chin you would contract the sternocleidomastoid muscles, along with the longus capitis and longus colli. To raise the chin you would contract the splenius and trapezius muscles.
In order to indicate no, you would rotate the head to the left and right while keeping the chin level. This move also utilises the sternocleidomastoid muscles, as well as the semispinalis capitis and the splenius capitis. Keeping the chin level requires some tension in the trapezius and splenius muscles as well, but they are more for support than motion in this case.