So Joshua and all Israel allowed themselves to be beaten before them, and they fled in the direction of the wilderness.