Checks if two words/phrases are anagrams.