A necessary condition for omnigenity in stellarators