Check if two words are anagrams.