Example 4. In a militia squad marching, the main and deputy machine gunners must be adjacent, and they must not stand at the head or the tail of the line. How many ways can the squad be arranged?
Solution: Still using the insertion method: The other 8 people can be arranged arbitrarily, with $8!$ arrangements. The main and deputy machine gunners can only be inserted into the 7 intervals formed by these 8 people, and the 2 people have a sequence, so there are $7 \times 2!$ ways to insert. Therefore, the total number of arrangements is $7 \times 2! \times 8! = 564480$.