Anagrams

Two words, s and t, are anagrams if we can rearrange the letters of s to
get t. 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.

Problem information

Author: Salvador Roura
Event: Vint-i-quatrè Concurs de Programació de la UPC - Final
Date: 2026-10-07

Generation: 2026-09-28T06:09:43.689Z

© Jutge.org, 2006–2026.
https://jutge.org
