No.69 Rearrange the Characters Freely
Problem Statement
You are given a string $A$ and a string $B$ of the same length.
You may freely rearrange the order of the characters in string $A$.
Determine whether string $A$ can be made identical to string $B$.
Input
A B
String $A$ and string $B$ are strings of at least $1$ and at most $10$ characters.
The length of string $A$ and the length of string $B$ are always the same.
All characters are lowercase letters from a to z.
Output
Print YES if it is possible, and NO if it is impossible.
Do not forget the newline.
Sample
Sample 1
Input
dog god
Output
YES
Swapping d and g in dog gives god.
Therefore, the answer is YES.
Sample 2
Input
cat tea
Output
NO
No matter how cat is rearranged, it cannot become tea.
Therefore, the answer is NO.
Sample 3
Input
silence license
Output
YES
Sample 4
Input
yukicoder yukicoder
Output
YES
The strings may already match from the start.
Sample 5
Input
hurjztkyua urjukzthua
Output
NO
Meaningless strings may also appear.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nmnmnmnmnmnmnm