Anagram Check

Lab Python Intermediate 20 points

Read two words and print YES if they are anagrams (same letters, same counts, ignoring case), else NO.

Input

Two lines.

Output

YES or NO

Example

Input

Listen
Silent

Output

YES
Sample input available Sample output available
Editor
Python

Hints

sorted(word) returns the letters in order.

A set would lose the letter counts - aab vs abb.

Solution explanation

Sorting the letters gives a canonical form; equal forms mean anagrams.

Show solution
a = input().lower()
b = input().lower()
print("YES" if sorted(a) == sorted(b) else "NO")
Output
Answer
HOME LEARN COMMUNITY DASHBOARD