It’s always good to end a conversation by showing your appreciation.
Excellent talks are rare, so you might as well tell the person how much it meant to you.
For example, you can say:
“Wow, it was really nice speaking with you, I’m glad I got the chance.”
Showing your appreciation and respect for the conversation makes it that much more notable.