AlgoUniversity
  • Go Back
Discussion
String Transformation :

Author

Akshay Sharma

Difficulty Level : Medium

Submissions : 298

Asked In : Sprinklr

Marks :100

: 0 | : 0

You are given two strings S and T of the same length. You need to determine if its possible to transform string S into T with the following rule any number of times.

You can map a character from string S to a character of string T and replace all the occurrences of that character in string S.

Input

The first line of input contains two strings S and T(1≤S,T≤105)

Output

For every test case return YES Or NO in a new line indicating its possible to transform S into T

Examples

Input
abc bbb
Output
YES
Input
abcde aa
Output
NO

Note

All occurrences of a character must be replaced with another character while preserving the order of the character.

No two characters may map to the same character, but a character may map to itself

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.