You have
x=3
so when you do
ans=solve(yy==c,x)
that is the same as
ans=solve(yy==c,3)
and 3 is never equal to 0, so the system is unsolvable.
I recommend that you avoid this problem in future by never assigning a value to a symbolic variable that has been used in an expression -- not unless you proceed to immediately overwrite the expression with the new variation on the variable. Use the three-parameter version of subs() instead.
x1=-1
a=subs(y,x,x1)
x2=3
b=subs(y,x,x2)
Now x is still a symbolic variable.
