How to find unambiguous grammar for palindromes

I am trying to figure out how to make an unambiguous grammar for palindromes over the alphabet {a, b}. I have the following, but it is ambiguous and causes conflicts in yacc.

S -> a S a
| b S b
| a
| b
| ε


Is there a way to convert this to an unambiguous grammar? Or is there another solution?