Anagrams P76662


Statement
 

pdf   zip

Two words, ss and tt, are anagrams if we can rearrange the letters of ss to get tt. For instance, “race” is an anagram of “care”.

You are given four words. Determine whether you can divide them into two groups such that, after concatenating the words within each group, the two resulting strings are anagrams. Each word must belong entirely to one group and be used exactly once.

Input

Input consists of several cases, each with four words made up only of lowercase letters. You can assume that the total number of letters of each case is not larger than 1000.

Output

For each case, print “yes” or “no”, as appropriate.

Public test cases
  • Input

    stone race care notes
    a b c d
    aa ba bb ab
    zzzz z z z
    zzzzz zz zz z
    voices ran not conversation
    thee yes the eyes
    

    Output

    yes
    no
    yes
    no
    yes
    yes
    yes
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++