From the FIA:
This is a signal of danger and should be shown to drivers in two ways with the following meanings:
– Single waved: Reduce your speed, do not overtake and be prepared to change direction. There is a hazard beside or partly on the track.
– Double waved: Reduce your speed, do not overtake and be prepared to change direction or stop. There is a hazard wholly or partly blocking the track.
Yellow flags should normally be shown only at the marshals’ post immediately preceding the hazard.
In some cases however the Clerk of the Course may order them to be shown at more than one marshals’ post preceding an incident.
Overtaking is not permitted between the first yellow flag and the green flag displayed after the incident.
Yellow flags should not be shown in the pit lane unless there is an incident of which the driver should be made aware.
This also applies to lights when substituted for flags.