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 \equiv \ldots \equiv 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& \equiv & c_1  (\text{mod } p) \\\\
\vdots & & \vdots\\\\
a_n x + b_n y& \equiv & 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. I know I could use linear algebra to solve Ax = c, but I'd like some conditions which can be tested locally.