Answer
The head nod gesture which is non-verbal gesture for "Yes" ( I agree/ I understand) , is executed in the following way:
Action of flexing neck and bringing head forward and downward--nodding -- is executed by combined actions of longus capitis, rectus capitis anterior, and longus colli muscles --and others.
Action of extending the neck and bringing the head up and back is executed by combined actions of the trapezius (upper), splenius capitis, semispinalis capitis--and others.
If the action is very vigorous the sternocleidomastoid and intercostals may become involved
Work Step by Step
The "head shake," which is non-verbal gesture for "No" or "I Don't Agree," is executed by the following muscles.
Longus colli
Splenius
Sternocleidomastoid --and others.