Hullin, Chapter Two, Mishnah Eight
Our mishnah deals with a person who slaughters an animal for idolatrous purposes.
1) If one slaughtered [an animal] as a sacrifice to mountains, hills, seas, rivers, or deserts, the slaughtering is invalid.
2) If two persons held a knife and slaughtered [an animal], one intending it as a sacrifice to one of these things and the other for a legitimate purpose, the slaughtering is invalid.
Section one: If a person slaughtered an animal as a sacrifice to a natural phenomenon, such as a mountain, body of water or desert, the animal is invalid, even though it was slaughtered properly. Note that worship of mountains and hills was also referred to in Mishnah Avodah Zarah 3:5 and seems to be based on Deuteronomy 12:2.
Section two: We learned in mishnah two of this chapter that if two people jointly slaughter, the slaughtering is valid. Both are participating in the slaughtering. Therefore, if one of them intends to slaughter the animal as an idolatrous sacrifice, the animal is invalid.