I am trying to solve a cryptography-related question, which asks the conditions for an affine cypher's key to be involuntary. This implies $E_k=D_k$, where $E_k$ and $D_k$ are encryption and decryption functions for the involuntary key k over some $ℤ_n$.
This implies that $E_k(E_k(x))=x$, solving which should give us the required conditions. Now, this is where I am confused. The solutions I found online (Q3.b here) solve this as
$E_k(E_k(x))=(a(ax+b)+b) \mod n=x$
Should it not be $(a((ax+b)\mod n)+b)\mod n$.
Why can we ignore the modulo operator on the first time encryption?