Warring Somali factions reach accord