100 atcoder#ABC110C. [ABC110C] String Transformation
[ABC110C] String Transformation
Score : points
Problem Statement
You are given strings and consisting of lowercase English letters.
You can perform the following operation on any number of times:
Operation: Choose two distinct lowercase English letters and , then replace every occurrence of with , and every occurrence of with .
Determine if and can be made equal by performing the operation zero or more times.
Constraints
- and consists of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
If and can be made equal, print Yes
; otherwise, print No
.
azzel
apple
Yes
azzel
can be changed to apple
, as follows:
- Choose
e
as andl
as .azzel
becomesazzle
. - Choose
z
as andp
as .azzle
becomesapple
.
chokudai
redcoder
No
No sequences of operation can change chokudai
to redcoder
.
abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxjstdwgpzmonu
Yes