Complex sentence: The inhabitants of the valley were forced to build a high wall around it with only two gates, one toward the mountains and one toward the river.
Split into simpler sentences: The inhabitants of the valley were forced to build a high wall all around the valley. The wall has only two gates, one towards the mountains and one towards the river.