Is it okay to keep a "Thank you" slide before references? I am preparing a presentation in LaTeX and got at least seven pages for references only.

In general, as far as I know, a "thank you" slide of a presentation is the termination slide of the presentation, i.e., it comes at the end after references.

Since my presentation part, which demands explanation, ends with a page before starting of references, and I got a long list of references, is it okay to keep my "thank you" slide before references?
Don't even think about going through seven slides of references. Put them in a separate handout or web link. Make the thank you slide the last (or next to last, if you are going to ask for questions).

If you want the references on slides so you have just one document, put them at the end and don't visit them.

Addition: Many commenters note that "thank you"  might not be the best way to end your presentation. Consider verbal thanks and just your conclusions on the final slide, perhaps with a request for questions.