Somalia reaches agreement paving way for elections -foreign