Was the Egyptian military right to oust president Mohamed Morsi?

Was the Egyptian military right to oust president Mohamed Morsi?