Skip to content
UPEEC

Isomorphic Strings

Medium#strings#hashing· solved by 0 · time limit 2.0 s

Two strings are isomorphic if the letters of one can be replaced (consistently, one-to-one) to get the other — egg/add yes, foo/bar no. Print Yes or No.

Input

Two lines with one lowercase word each.

Output

Yes or No.

Constraints

Each word has up to 10510^5 letters.

Sample 1

Input

egg
add

Output

Yes

Sample 2

Input

foo
bar

Output

No

Sign in or join free to run and submit your solution.