First, trademark rights in the U.S. vest by use, so the basic principal is "first in time, first in right" (i.e., first one to use a mark has the rights to it). Of course, there are a lot of qualifiers and caveats to that principal, so you should take it as a starting point to the analysis, not the ultimate conclusion.
Second, even if both parties end up with rights -- or if yours are somehow junior to the second party's rights -- then you still have to undertake the likelihood of confusion analysis to gauge possible liability for infringement. Search the groups for "likelihood of confusion" and read the resulting threads. If you still have questions after doing that, post back here.