Sorry about the title, I can't remember how this works and after an hour on the internet I still have no clue what to call it. I would like to check my method on the following equations.

Solve

Since we can divide through and get

This is the line I am not sure of, but it does give a correct answer (x = 2) for the original equation.

again,

Solve

Now in this case gcd(6, 7) = 1, so we can't "reduce" the mod by dividing.

How far off base am I? I could swear I've seen some way to reduce the mod to make the equation simpler, but I cannot for the life of me remember what the circumstances were.

-Dan