Answer: For any commutative ring $A$ and any $n\times n$ matrix $R\in Mat(n,A)$ with coefficients in $A$ you may define the adjunct matrix $adj(R)$. This matrix has the property that $adj(R)R=Radj(R)=det(R)Id$ where $Id$ is the $n\times n$ identity matrix and $det(R)$ is the "determinant". The determinant $der(R)\in A$ is multiplicative: $det(RR')=det(R)det(R')$. From this it follows that $R$ is invertible (there is a matrix $R^{-1}\in M(n,A)$ with $RR^{-1}=R^{-1}R=Id$) iff $det(R)\in A^*$ is a unit in $A$.
Proof: If $R$ is invertible it follows $RR^{-1}=Id$ hence $det(RR^{-1})=det(R)det(R^{-1})=det(Id)=1$ hence $det(R)\in A^*$. Conversely if $det(R)\in A^*$ it follows $det(R)^{-1}adj(R):=R^{-1}$ is an inverse in $M(n,A)$.
You may check that in your case it follows $adj(s)$ is upper triangular, hence in your case the inverse (if it exists) lives in $S$. There is an explicit formula for the adjunct matrix for $2\times 2$-matrices:
Why the inverse of a matrix involves division by the determinant?