A monotonicity formula for Yang-Mills fields