Atv stereo

I need some help. I built a box for the front of my Honda rancher 420 and I put a stereo in it. I have the yellow memory wire hooked straight to the battery then the red 12v wire and the ground connected to a 12v plug to get power from a 12v acc socket. When I unplug the 12v plug I loose my memory. How can hook it up to keep my memory but not run my battery dead?
This is my first stereo installed on atv. Any help is apprecited.