Find the mistake in the below maths equations

A = 2
A(A-1) = 2(A-1)
A2-A = 2A-2
A2-2A = A-2
A(A-2) = A-2
A = 1

The equation is solved the right way, apart from one little detail. There must be stated that x does not equal y, because there would be dividing by zero, which is not defined in maths.