Let $p$ be a prime. Consider the following congruences: $$ \begin{array}{lcl} a_1 x & = & c_1 (\text{mod } p) \\\\ \vdots & & \vdots\\\\ a_n x & = & c_n (\text{mod } p) \\ \end{array} $$ Obviously, there is a solution $x$ to this system if and only if $c_1 / a_1 = \ldots = c_n/a_n$. I'd like to know if there is such a, sufficient and necessary, condition for more complex congruences like: $$ \begin{array}{lcl} a_1 x + b_1 y& = & c_1 (\text{mod } p) \\\\ \vdots & & \vdots\\\\ a_n x + b_n y& = & c_n (\text{mod } p) \\ \end{array} $$ I'm actually interested in the case where there are $m$ variables, but the case of $m=2$ is also of interest to me.