First, learn to use matrices, NOT numbered variables. Assuming that you have a matrix X, and a matrix Y, with x1 x2, y1, y2 as columns...
then ONLY if the matrix X is non-singular does a solution exist. So is X singular? It must be of full rank if it is non-singular, or a small condition number.
So X is non-singular. In that case,
Does S work? Of course. I could also have written it as S = Y*inv(X), but Y/X is a better choice in MATLAB.
So effectively zero, only floating point trash remains.