I’ve gained back 10 of the 20 I lost

I’m (37F, 5’7) feeling discouraged…how do I stop this yo-yo effect? I went from 180 to 160 through CICO and exercise over about a year, and now I’m back at 170 again.

Am I just going to have to count calories, weigh everything I eat and workout 4-5 days a week forever? It just doesn’t seem sustainable in the long term but I guess I will need to.