Anagram Check

MEDIUM · C · 2000ms

A plagiarism-check feature needs to verify whether one submitted title is just a rearranged (anagram) version of another. Read two strings A and B of equal length. Print "YES" if B is an anagram of A (same letters, same counts, any order), else "NO".

Input

Two strings A and B on two lines.

Output

"YES" or "NO".

Constraints

1 ≤ |A|=|B| ≤ 10^5

Sample Input

listen
silent

Sample Output

YES
main.c
Loading editor…

Write C, then Run (custom I/O) or Submit (sample tests). ⌘/Ctrl+Enter submits.

Anagram Check · DIU ContestHub