A yawn is a reflex when the oxygen level in the blood drops.By yawing more oxygen enters in our system ans it is a huge breath.When we are tired we overload our body as it needs rest and thus it needs extra oxygen to keep going so yawning provide that oxygen needed.So we would keep yawning until we get some rest.