Theorem. The no-arbitrage condition is satisfied iff there is a $\tilde\pi\gg0$ such that $\tilde\pi M=0$.
If there is such a $\tilde\pi$, wlog the first component can be taken to be 1. Let \begin{equation*} P(q)=\{\pi\in\R^S_{++}:(1,\pi)\cdot M=0\}. \end{equation*} Then $\pi\in P(q)$ iff \begin{equation*} q^j=\pi_1a^j_1+\cdots+\pi_Sa^j_S. \end{equation*} Any member of $P(q)$ is called a state price vector. $\dim P(q)=S-\rank A$. So $\pi$ will be unique iff $\rank A=S.$ In this case, markets are said to be complete.