Probably. Generally the only reason someone does that is as a slightly snarky way to remind you to thank them. But don't just say "thankyou" as though it's an automatic response. Either
- apologize for the omission "sorry, I didn't thank you for [action/item]. [Optional: an explanation of unusual circumstances eg I've been awake 36 hours.] [
[SMILE. You are grateful for the course correction.]
- look puzzled like you don't know why they're saying that to you. This applies if you didn't need to thank them for their action. (As a Canadian I'm a bit of an overthanker so am having trouble coming up with an example. Maybe if you held a door for someone and they said "you're welcome" as they went through.)
Don't just thank them. If nothing else, make a note that this person likes to be thanked, and be sure to do it next time.