egg add
YES
import sys
lines=sys.stdin.read().splitlines()
if len(lines)<2: sys.exit(0)
s=lines[0].strip()
t=lines[1].strip()
if len(s)!=len(t):
sys.stdout.write('NO')
else:
st={}
ts={}
ok=True
for a,b in zip(s,t):
if a in st and st[a]!=b:
ok=False
break
if b in ts and ts[b]!=a:
ok=False
break
st[a]=b
ts[b]=a
sys.stdout.write('YES' if ok else 'NO')
import sys
lines=sys.stdin.read().splitlines()
if len(lines)<2: sys.exit(0)
s=lines[0].strip()
t=lines[1].strip()
if len(s)!=len(t):
sys.stdout.write('NO')
else:
st={}
ts={}
ok=True
for a,b in zip(s,t):
if a in st and st[a]!=b:
ok=False
break
if b in ts and ts[b]!=a:
ok=False
break
st[a]=b
ts[b]=a
sys.stdout.write('YES' if ok else 'NO')