87 #ABC110C. [ABC110C] String Transformation

[ABC110C] String Transformation

Score : 300300 points

Problem Statement

You are given strings SS and TT consisting of lowercase English letters.

You can perform the following operation on SS any number of times:

Operation: Choose two distinct lowercase English letters c1c_1 and c2c_2, then replace every occurrence of c1c_1 with c2c_2, and every occurrence of c2c_2 with c1c_1.

Determine if SS and TT can be made equal by performing the operation zero or more times.

Constraints

  • 1S2×1051 \leq |S| \leq 2 \times 10^5
  • S=T|S| = |T|
  • SS and TT consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

SS

TT

Output

If SS and TT can be made equal, print Yes; otherwise, print No.

azzel
apple
Yes

azzel can be changed to apple, as follows:

  • Choose e as c1c_1 and l as c2c_2. azzel becomes azzle.
  • Choose z as c1c_1 and p as c2c_2. azzle becomes apple.
chokudai
redcoder
No

No sequences of operation can change chokudai to redcoder.

abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxjstdwgpzmonu
Yes