How is it that Matthew 24:7 and Mark 13:8 are the same text?

For nation shall rise against nation, and kingdom against kingdom: and there shall be famines, and pestilences, and earthquakes, in divers places.