Absolutely. Agents specialize in the genres where they know editors (or they specialize, SO they know editors) and of course some publishers don't publish fantasy at all, while others focus on it.
You can get basic information on this by looking at the books you think yours resemble. You can generally find an author's agent just by googling the author's name and the word 'agent', and you can obviously find the book's publisher just by looking at the book.
There are also lists available. Assuming you're going the traditional 'agent then publisher' route, check out querytracker.net and/or agentquery.com. You could also look at the SciFi Writers of America site, paying special attention to their "Writer Beware" section.
Good luck with it.