Buggy python submission (verdict: Time Limit Exceeded):
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s0[i]!=t0[i]:
    s_tmp=s0[i]
    t_tmp=t0[i]
    s0=s0.replace(s0[i],'0').replace(t0[i],'1').replace('0',t_tmp).replace('1',s_tmp)
if s0==t0:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s0[i]!=t0[i]:
    s_tmp=s0[i]
    t_tmp=t0[i]
    s0=s0.replace(s0[i],'0')
    s0=s0.replace(t0[i],'1')
    s0=s0.replace('0',t_tmp)
    s0=s0.replace('1',s_tmp)
if s0==t0:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s0[i]!=t0[i]:
    s_tmp=s0[i]
    t_tmp=t0[i]
    s0=s0.replace(s0[i],'0')
    s0=s0.replace(t0[i],'1')
    s0=s0.replace('0',t_tmp)
    s0=s0.replace('1',s_tmp)
if s0==t0:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
s,t=list(input()),list(input())
n=len(s)

for i in range(n):
  ss = [j for j, x in enumerate(s) if x == s[i]]
  tt = [j for j, x in enumerate(t) if x == t[i]]
  if ss!=tt:
    print('No')
    sys.exit()
print('Yes')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
s,t=list(input()),list(input())
n=len(s)
for i in range(n):
  if s.count(s[i])!=t.count(t[i]):
    print('No')
    sys.exit()
print('Yes')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
s,t=list(input()),list(input())
n=len(s)
for i in range(n):
  if s.count(s[i])!=t.count(t[i]):
    print('No')
    sys.exit()
print('Yes')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
s,t=list(input()),list(input())
n=len(s)
m=len(t)
ss=[0]*n
tt=[0]*n
for i in range(n):
  ss[i]=s.count(s[i])
for i in range(m):
  tt[i]=t.count(t[i])
if ss==tt:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
s0,t0=input(),input()
s,t=list(s0),list(t0)
n=len(s)
sn=set(s)
tn=set(t)
if len(sn)!=len(tn) or len(s)!=len(t):
  print('No')
  sys.exit()
for i in range(n):
  if s[i]!=t[i]:
    if s.index(s[i])!=t.index(t[i]):
      print('No')
      sys.exit()
print('Yes')