AlgoUniversity
  • Go Back
Discussion
Anagrams :

Author

Yash Sahijwani

Difficulty Level : Easy

Submissions : 61

Asked In : Virtusa

Marks :10

: 1 | : 0

Two strings are considered anagrams, if the letters of each string can be rearranged to make the two strings equal.

Given two strings $$$s$$$ and $$$t$$$, find whether they are anagrams or not.

Input

The first line of input consists of a string $$$s$$$ $$$(1 \leq |s| \leq 10^6)$$$ consisting of all lowercase English alphabet characters. The second line of input consists of a string $$$t$$$ $$$(1 \leq |t| \leq 10^6)$$$ consisting of all lowercase English alphabet characters.

Output

Output a single word - "YES" if the two strings are anagrams, otherwise "NO".

Example

Input
abcd
dcba
Output
YES

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.