qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys
s = input()
t = input()
yetlist = {}
for i in range(len(s)):
    if s[i] in yetlist:
        if t[i] != yetlist[s[i]]:
            print("No")
            sys.exit()
    else:
        yetlist[s[i]] = t[i]
            
print("Yes")

Fixed code:
import sys
s = input()
t = input()
yetlist = {}
yetlist2 = {}
for i in range(len(s)):
    if s[i] in yetlist:
        if t[i] != yetlist[s[i]]:
            print("No")
            sys.exit()
    else:
        yetlist[s[i]] = t[i]
    if t[i] in yetlist2:
        if s[i] != yetlist2[t[i]]:
            print("No")
            sys.exit()
    else:
        yetlist2[t[i]] = s[i]   
            
print("Yes")
Buggy code:
s = list(input())
t = list(input())

print(s)
print(t)

sset = list(set(s))
tset = list(set(t))

print(sset)
print(tset)

s_getindex = []
t_getindex = []

for j in range(len(sset)):
    s_getindex.append([i for i, x in enumerate(s) if x == sset[j]])

for jj in range(len(tset)):
    t_getindex.append([ii for ii, y in enumerate(t) if y == tset[jj]])

print(s_getindex)
print(t_getindex)

check_s = []
check_t = []
ans = 0

for k in range(len(sset)):
    if len(s_getindex[k]) != 1:
        for m in s_getindex[k]:
            check_s.append(t[m])
        if len(set(check_s)) != 1:
            ans = ans + 1

for kk in range(len(tset)):
    if len(t_getindex[kk]) != 1:
        for mm in t_getindex[kk]:
            check_t.append(s[mm])
        if len(set(check_t)) != 1:
            ans = ans + 1

print(ans)

if ans == 0:
    print("Yes")
else:
    print("No")


Fixed code:
s = list(input())
t = list(input())

#print(s)
#print(t)

sset = list(set(s))
tset = list(set(t))

#print(sset)
#print(tset)

s_getindex = []
t_getindex = []

for j in range(len(sset)):
    s_getindex.append([i for i, x in enumerate(s) if x == sset[j]])

for jj in range(len(tset)):
    t_getindex.append([ii for ii, y in enumerate(t) if y == tset[jj]])

#print(s_getindex)
#print(t_getindex)

check_s = []
check_t = []
ans = 0

for k in range(len(sset)):
    if len(s_getindex[k]) != 1:
        for m in s_getindex[k]:
            check_s.append(t[m])
#        print(check_s)
#        print(len(set(check_s)))
        if len(set(check_s)) != 1:
            ans = ans + 1
#            print(s[m])
        check_s.clear()

for kk in range(len(tset)):
    if len(t_getindex[kk]) != 1:
        for mm in t_getindex[kk]:
            check_t.append(s[mm])
        if len(set(check_t)) != 1:
            ans = ans + 1
#            print(t[mm])
        check_t.clear()

#print(ans)

if ans == 0:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
t = input()
while s != "":
  x = s[0]
  y = t[0]
  for i in range(len(s)):
    if (s[i] == "x" and t[i] != "y") or (s[i] != "x" and t[i] == "y"):
      print("No")
      exit()
  s = s.replace(x,"")
  t = t.replace(y,"")
print("Yes")

Fixed code:
s = input()
t = input()
while s != "":
  x = s[0]
  y = t[0]
  for i in range(len(s)):
    if (s[i] == x and t[i] != y) or (s[i] != x and t[i] == y):
      print("No")
      exit()
  s = s.replace(x,"")
  t = t.replace(y,"")
print("Yes")
Buggy code:
s=input()
t=input()
n=len(s)

dic={}
ans='Yes'
for i in range(n):
    if s[i] in dic:
        if dic[t[i]]==t[i]:
            continue
        else:
            ans='No'
            break
    
    if t[i] not in dic:
        dic[t[i]]=s[i]
    else:
        if dic[t[i]]==s[i]:
            continue
        else dic[t[i]] !=s[i]:
            ans='No'
            break

print(ans)

Fixed code:
s=input()
t=input()
n=len(s)

dic={}
ans='Yes'
for i in range(n):
    if t[i] not in dic:
        dic[t[i]]=s[i]
    
    else:
        if dic[t[i]]==s[i]:
            continue
        else :
            ans='No'
            break
    
if len(dic)!=len(set(dic.values())):
    ans='No'
print(ans)
Buggy code:
s = input()
t = input()
a = b = {}
for c, d in zip(s, t) :
    if a.setdefault(c, d) != d : print("No") ; break
    if b.setdefault(d, c) != c : print("No") ; break
else : print("Yes")

Fixed code:
s = input()
t = input()
a = {} ; b = {}
for c, d in zip(s, t) :
    if a.setdefault(c, d) != d : print("No") ; break
    if b.setdefault(d, c) != c : print("No") ; break
else : print("Yes")
Buggy code:
S = input()
T = input()
 
if len(S) != len(T):
    print("No")
    exit()
 
D = {}
for s, t in zip(S, T):
    if s not in D:
        D[s] = t
    elif D[s] != t:
        print("No")
        exit()
 
print("Yes")

Fixed code:
S = input()
T = input()
 
if len(set(S)) != len(set(T)):
    print("No")
    exit()
 
D = {}
for s, t in zip(S, T):
    if s not in D:
        D[s] = t
    elif D[s] != t:
        print("No")
        exit()
 
print("Yes")
Buggy code:
S = input()
T = input()

n = len(S)
c1s = {}
c2s = {}
ans = True
for i in range(n):
    if not ans:
        break

    if S[i] in c1s:
        if c1s[S[i]] != T[i]:
            ans = False
            break
    else:
        c1s[S[i]] = S[i]
    if T[i] in c2s:
        if c2s[T[i]] != S[i]:
            ans = False
            break
    else:
        c2s[T[i]] = T[i]


print('Yes' if ans else 'No')



Fixed code:
S = input()
T = input()

n = len(S)
c1s = {}
c2s = {}
ans = True
for i in range(n):
    if not ans:
        break

    if S[i] in c1s:
        if c1s[S[i]] != T[i]:
            ans = False
            break
    else:
        c1s[S[i]] = T[i]
    if T[i] in c2s:
        if c2s[T[i]] != S[i]:
            ans = False
            break
    else:
        c2s[T[i]] = S[i]


print('Yes' if ans else 'No')
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    T2 = T[:]
    for i in range(len(S)):
        if S[i] == T2[i]:
            continue
        from_c = T2[i]
        to_c = S[i]
        T2 = T2.translate(str.maketrans({from_c: to_c, to_c: from_c}))

    if S != T2:
        print("No")
    else:
        print("Yes")

main()


Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    S = input().strip()
    T = input().strip()
    m = {}
    for i in range(len(T)):
        if T[i] in m:
            if m[T[i]] != S[i]:
                print("No")
                return
        m[T[i]] = S[i]

    T2 = T[:]
    for i in range(len(S)):
        if S[i] == T2[i]:
            continue
        from_c = T2[i]
        to_c = S[i]
        T2 = T2.translate(str.maketrans({from_c: to_c, to_c: from_c}))

    if S != T2:
        print("No")
    else:
        print("Yes")

main()
Buggy code:
s_to_t = {}
t_to_s = {}

for i in range(len(s)):
    if s[i] not in s_to_t:
        if t[i] not in t_to_s:
            s_to_t[s[i]] = t[i]
            t_to_s[t[i]] = s[i]
            continue
        else:
            print('No')
            exit(0)
    elif s_to_t[s[i]] == t[i] and t_to_s[t[i]] == s[i]:
        continue
    else:
        print('No')
        exit(0)
        
print('Yes')            


Fixed code:
s = input()
t = input()


s_to_t = {}
t_to_s = {}

for i in range(len(s)):
    if s[i] not in s_to_t:
        if t[i] not in t_to_s:
            s_to_t[s[i]] = t[i]
            t_to_s[t[i]] = s[i]
            continue
        else:
            print('No')
            exit(0)
    elif s_to_t[s[i]] == t[i] and t_to_s[t[i]] == s[i]:
        continue
    else:
        print('No')
        exit(0)
        
print('Yes')
Buggy code:
import collections as C
import sys
s = input()
t = input()

if len(set(s)) != len(set(t)):
    print("NO")
    sys.exit()

ans = [0] * len(s)
stock = C.Counter([])
for i in range(len(s)):
    if s[i] not in stock.keys():
        stock[s[i]] = t[i]
    ans[i] = stock[s[i]]

ss = "".join(ans)

print("Yes") if ss == t else print("No")


Fixed code:
import collections as C
import sys
s = input()
t = input()

if len(set(s)) != len(set(t)):
    print("No")
    sys.exit()

ans = [0] * len(s)
stock = C.Counter([])
for i in range(len(s)):
    if s[i] not in stock.keys():
        stock[s[i]] = t[i]
    ans[i] = stock[s[i]]

ss = "".join(ans)

print("Yes") if ss == t and len(list(stock.keys())) == len(list(stock.values())) else print("No")
Buggy code:
S = input()
T = input()
trans_dict = dict()
flg = 0
for s, t in zip(S, T):
    if s == t:
        continue
    else:
        if trans_dict.get(s) is None:
            trans_dict[s] = t
            S.replace(s, t)
        elif trans_dict.get(s) == t:
            continue
        else:
            flg = 1
            break
if flg == 1:
    print("No")
else:
    print("Yes")

Fixed code:
S = input()
T = input()
trans_dict = dict()
trans_dict_ = dict()
flg = 0
for s, t in zip(S, T):
    if trans_dict.get(s) is None:
        trans_dict[s] = t
    elif trans_dict.get(s) == t:
        continue
    else:
        flg = 1
        break
    if trans_dict_.get(t) is None:
        trans_dict_[t] = s
    elif trans_dict.get(t) == s:
        continue
    else:
        flg = 1
        break
if flg == 1:
    print("No")
else:
    print("Yes")
Buggy code:
S = input()
T = input()
len_s = len(S)
ok = True
s_dict = {}
for i in range(len_s):
  if S[i] in s_dict and s_dict[S[i]] != T[i]:
    ok = False
    break
  s_dict[S[i]] = T[i]
if ok:
  print('Yes')
else:
  print('No')


Fixed code:
S = input()
T = input()
len_s = len(S)
ok = True
s_dict = {}
t_dict = {}
for i in range(len_s):
  if S[i] in s_dict and s_dict[S[i]] != T[i]:
    ok = False
    break
  if T[i] in t_dict and t_dict[T[i]] != S[i]:
    ok = False
    break
  s_dict[S[i]] = T[i]
  t_dict[T[i]] = S[i]
if ok:
  print('Yes')
else:
  print('No')
Buggy code:
import collections
s = input()
t = input()

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    else:
        if t[i] == s[i]:
            continue
        else:
            d[s[i]] = t[i]

print("Yes" if flag else "No")

Fixed code:
import collections
s = input()
t = input()

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    elif t[i] in d.values():
        if d.get(s[i]) == t[i]:
            continue
        else:
            flag=False
            break
    else:
        d[s[i]] = t[i]

print("Yes" if flag else "No")
Buggy code:
def main():
    S=input()
    T=input()
    X=[]
    Y=[]
    flag=False
    for i in range(len(S)):
        al=False
        if T[i] in Y:
            al=True
            if X[Y.index(T[i])]!=S[i]:
                flag=False
                break
        if S[i] in X:
            al=True
            if Y[X.index(S[i])]!=T[i]:
                flag=False
                break
        if al==False:
            X.append(S[i])
            Y.append(T[i])
    if flag:
        print("Yes")

if __name__=="__main__":
    main()

Fixed code:
def main():
    S=input()
    T=input()
    X=[]
    Y=[]
    flag=True
    for i in range(len(S)):
        al=False
        if T[i] in Y:
            al=True
            if X[Y.index(T[i])]!=S[i]:
                flag=False
                break
        if S[i] in X:
            al=True
            if Y[X.index(S[i])]!=T[i]:
                flag=False
                break
        if al==False:
            X.append(S[i])
            Y.append(T[i])
    if flag:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()
Buggy code:
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

S = input()
T = input()

dict = {}
flg = 1
for i in range(len(S)):
    if S[i] in dict and T[i] in dict:
        if S[i] != dict[T[i]] or T[i] != dict[S[i]]:
            flg = 0
            break
    elif S[i] not in dict and T[i] not in dict:
        dict[S[i]] = T[i]
        dict[T[i]] = S[i]
    else:
        flg = 0
        break

if flg:
    print("Yes")
else:
    print("No")

Fixed code:
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

S = input()
T = input()

dict = {}
re_dict = {}
flg = 1
for i in range(len(S)):
    if S[i] in dict:
        if T[i] != dict[S[i]]:
            flg = 0
            break
    else:
        dict[S[i]] = T[i]
        if T[i] in re_dict:
            if re_dict[T[i]] != S[i]:
                flg = 0
                break
        else:
            re_dict[T[i]] = S[i]

if flg:
    print("Yes")
else:
    print("No")
Buggy code:
from collections import Counter as c
s=input()
t=input()
if sorted(s.values())==sorted(t.values()):
  print("Yes")
else:
  print("No")

Fixed code:
from collections import Counter as c
s=input()
S=c(s)
t=input()
T=c(t)
if sorted(S.values())==sorted(T.values()):
  print("Yes")
else:
  print("No")
Buggy code:
import collections
S = (input())
T = (input())

count1 = collections.Counter(S)
count2 = collections.Counter(T)

count1=sorted(count1.items(), key=lambda x: x[1])
count2=sorted(count2.items(), key=lambda x: x[1])

if len(S) == len(T):
    if len(count1) != len(count2):
        print('No')
    else:
        for k1, k2 in zip(count1, count2):
            if k1[1] > 1:
                indexes = [i for i, x in enumerate(S) if x == k1[0]]
                indexes2 = [i for i, x in enumerate(S) if x == k1[0]]
                if indexes != indexes2:
                    print('No')
            else:
                print('Yes')
else:
    print('No')

# for k1,k2 in zip(count1, count2, ):
#     if count1[k1] > 1:
#         [100 if i > 0 else i for i in l]


Fixed code:
import collections
S = (input())
T = (input())

count1 = collections.Counter(S)
count2 = collections.Counter(T)

count1=sorted(count1.items(), key=lambda x: x[1])
count2=sorted(count2.items(), key=lambda x: x[1])


indexes = []
indexes2 = []

if len(S) == len(T):
    if len(count1) != len(count2):
        print('No')
    else:
        for k1, k2 in zip(count1, count2):
            if k1[1] > 1:
                indexes.append(tuple([i for i, x in enumerate(S) if x == k1[0]]))
                indexes2.append(tuple([i for i, x in enumerate(T) if x == k2[0]]))
        if set(indexes) == set(indexes2):
            print('Yes')
        else:
            print('No')
else:
    print('No')

# for k1,k2 in zip(count1, count2, ):
#     if count1[k1] > 1:
#         [100 if i > 0 else i for i in l]
Buggy code:
import sys
from collections import Counter


def main():
    s = input()
    t = input()
    s_count = [0]*26
    t_count = [0]*26
    for i in range(ord("a"), ord("z")+1):
        s_count[i-97] = s.count(chr(i))
        t_count[i-97] = t.count(chr(i))
        print(s_count[i-97], t_count[i-97])
    s_count.sort()
    t_count.sort()
    if s_count == t_count:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Fixed code:
import sys
from collections import Counter


def main():
    s = input()
    t = input()
    s_count = [0]*26
    t_count = [0]*26
    for i in range(ord("a"), ord("z")+1):
        s_count[i-97] = s.count(chr(i))
        t_count[i-97] = t.count(chr(i))
    s_count.sort()
    t_count.sort()
    if s_count == t_count:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
Buggy code:
from collections import defaultdict
s = input()
t = input()
dic = defaultdict(lambda : None)
for x, y in zip(s, t):
    if dic[x] == None:
        dic[x] = y
    elif dic[x] != y:
        print('No')
        quit()
print('Yes')


Fixed code:
from collections import defaultdict
s = input()
t = input()
dic = defaultdict(lambda : None)
revdic = defaultdict(lambda : None)
for x, y in zip(s, t):
    if dic[x] == None and revdic[y] == None:
        dic[x] = y
        revdic[y] = x
    elif dic[x] != y or revdic[y] != x:
        print('No')
        quit()
print('Yes')
Buggy code:
S = list(input())
T = list(input())
S.sort()
T.sort()
SKind = []
TKind = []
cnt = 1
for i in range(1,len(S)):
    if i == 0:
        cnt+=1
    elif i == N-1:
        if S[i]==S[i-1]:
            cnt += 1
            SKind.append(cnt)
        else:
            SKind.append(cnt)
            SKind.append(1)
    elif S[i]==S[i-1]:
        cnt+=1
    elif S[i]!=S[i-1]:
        SKind.append(cnt)
        cnt = 1
#    print(SKind)
cnt = 1        
for i in range(1,len(T)):
    if i == 0:
        cnt+=1
    elif i == N-1:
        if T[i]==T[i-1]:
            cnt += 1
            TKind.append(cnt)
        else:
            TKind.append(cnt)
            TKind.append(1)
    elif T[i]==T[i-1]:
        cnt+=1
    elif T[i]!=T[i-1]:
        TKind.append(cnt)
        cnt = 1
#    print(TKind)
#print(SKind,TKind)
SKind.sort()
TKind.sort()
if SKind == TKind:
    print("Yes")
else: print("No")

Fixed code:
S = list(input())
T = list(input())
S.sort()
T.sort()
SKind = []
TKind = []
cnt = 1
for i in range(1,len(S)):
    if i == len(S)-1:
        if S[i]==S[i-1]:
            cnt += 1
            SKind.append(cnt)
        else:
            SKind.append(cnt)
            SKind.append(1)
    elif S[i]==S[i-1]:
        cnt+=1
    elif S[i]!=S[i-1]:
        SKind.append(cnt)
        cnt = 1
cnt = 1        
for i in range(1,len(T)):
    if i == len(T)-1:
        if T[i]==T[i-1]:
            cnt += 1
            TKind.append(cnt)
        else:
            TKind.append(cnt)
            TKind.append(1)
    elif T[i]==T[i-1]:
        cnt+=1
    elif T[i]!=T[i-1]:
        TKind.append(cnt)
        cnt = 1
SKind.sort()
TKind.sort()
if SKind == TKind:
    print("Yes")
else: print("No")
Buggy code:
S=input()
T=input()

D={}

ans=1
for s,t in zip(S,T):
    x=D.get(t, '')
    print(s,t,x)
    if x=='':
        D[t]=s
    else:
        print(s,t,x)
        if x!=s:
            ans=0
            break
            

print('Yes' if ans else 'No')

Fixed code:
S=input()
T=input()

D1={}
D2={}

ans=1
for s,t in zip(S,T):
    x=D1.get(t, '')
    if x=='':
        D1[t]=s
    else:
        if x!=s:
            ans=0
            break
            
    x=D2.get(s, '')
    if x=='':
        D2[s]=t
    else:
        if x!=t:
            ans=0
            break

print('Yes' if ans else 'No')
Buggy code:
S=input()
T=input()
L=len(S)

dds=defaultdict(int)
ddt=defaultdict(int)

for i in range(L):
    s=S[i]
    t=T[i]
    if dds[s]==0:
        dds[s]=t
    else:
        if dds[s]!=t:
            print("No")
            exit()
    if ddt[t]==0:
        ddt[t]=s
    else:
        if ddt[t]!=s:
            print("No")
            exit()
print("Yes")

Fixed code:
from collections import defaultdict

S=input()
T=input()
L=len(S)

dds=defaultdict(int)
ddt=defaultdict(int)

for i in range(L):
    s=S[i]
    t=T[i]
    if dds[s]==0:
        dds[s]=t
    else:
        if dds[s]!=t:
            print("No")
            exit()
    if ddt[t]==0:
        ddt[t]=s
    else:
        if ddt[t]!=s:
            print("No")
            exit()
print("Yes")
Buggy code:
import collections as c
s=input()
t=input()
d=c.defaultdict(list)
d2=c.defaultdict(list)
for k,v in enumerate(s):
    d[v].append(k)
for k,v in enumerate(t):
    d2[v].append(k)
if set(tuple(d.values()))==set(tuple(d2.values())):
    print("Yes")
else:
    print("No")

Fixed code:
import collections as c
s=input()
t=input()
d=c.defaultdict(list)
d2=c.defaultdict(list)
for k,v in enumerate(s):
    d[v].append(k)
for k,v in enumerate(t):
    d2[v].append(k)
a=set(tuple(i) for i in d.values())
b=set(tuple(i) for i in d2.values())
if a==b:
    print("Yes")
else:
    print("No")
Buggy code:
s=input()
t=input()
a,b={},{}
cnt=1

for i in range(len(s)):
    if s[i] not in a and t[i] not in b:
        a[s[i]]=cnt
        b[t[i]]=cnt
        ant+=1
    elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):
        pass
    else
        print("No")
        exit()
print("Yes")

Fixed code:
s=input()
t=input()
a,b={},{}
cnt=1

for i in range(len(s)):
    if s[i] not in a and t[i] not in b:
        a[s[i]]=cnt
        b[t[i]]=cnt
        cnt+=1
    elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):
        pass
    else:
        print("No")
        exit()
print("Yes")
Buggy code:
s=input()
t=input()
n=len(s)
A='abcdefghijklmnopqrstuvwxyz'
i=0
while A and i<n+1:
	if s==t:
		print('Yes')
		exit()
	if s[i]!=t[i]:
		if s[i] in A and t[i] in A:
			s=s.replace(s[i],'X').replace(t[i],s[i]).replace('X',t[i])
			A=A.replace(s[i],'').replace(t[i],'')
	i+=1
print('No')

Fixed code:
s=input()
t=input()
n=len(s)
A='abcdefghijklmnopqrstuvwxyz'
i=0
while A:
	if s==t:
		print('Yes')
		exit()
	if i==n:
		print('No')
		exit()
	if s[i]!=t[i]:
		if s[i] in A and t[i] in A:
			s=s.replace(s[i],'X').replace(t[i],s[i]).replace('X',t[i])
			A=A.replace(s[i],'').replace(t[i],'')
	i+=1
print('No')
Buggy code:
s=input()
t=input()
d={}
def C(a, b):
    for i in range(len(a)):
        if a[i] in d:
            if d[a[i]]!=b[i]:
                return False
        else:
            d[a[i]]=b[i]
    return True
if C(s, t)and C(t, s):
    print('Yes')
else:
    print('No')

Fixed code:
s=input()
t=input()
def C(a, b):
    d={}
    for i in range(len(a)):
        if a[i] in d:
            if d[a[i]]!=b[i]:
                return False
        else:
            d[a[i]]=b[i]
    return True
if C(s, t)and C(t, s):
    print('Yes')
else:
    print('No')
Buggy code:
S = input()
T = input()

dic = {}
dic_rev = {}


def solve():
    for s, t in zip(S, T):
        if t in dic.keys():
            if s != dic[t]:
                print('No')
                return
        else:
            dic[t] = s
    for s, t in zip(S, T):
        if t in dic_rev.keys():
            if t != dic_rev[s]:
                print('No')
                return
        else:
            dic_rev[s] = t
    print('Yes')
    return


solve()


Fixed code:
S = input()
T = input()

dic = {}
dic_rev = {}


def solve():
    for s, t in zip(S, T):
        if t in dic.keys():
            if s != dic[t]:
                print('No')
                return
        else:
            dic[t] = s
    for s, t in zip(S, T):
        if s in dic_rev.keys():
            if t != dic_rev[s]:
                print('No')
                return
        else:
            dic_rev[s] = t
    print('Yes')
    return


solve()
Buggy code:
S= input()
T= input()
SS = {}
TT = {}
for i in range(len(S)):
    s = S[i]
    t = T[i]
    if s not in SS:
        SS[s] = t
    elif SS[s] != t:
        print("No")
        break
    if if t not in TT:
        TT[t] = s
    elif TT[t] != s:
        print("No")
        break
else:
    print("Yes")

Fixed code:
S= input()
T= input()
SS = {}
TT = {}
for i in range(len(S)):
    s = S[i]
    t = T[i]
    if s not in SS:
        SS[s] = t
    elif SS[s] != t:
        print("No")
        break
    if t not in TT:
        TT[t] = s
    elif TT[t] != s:
        print("No")
        break
else:
    print("Yes")
Buggy code:
import collections

s = list(input())
t = list(input())

cs = collections.Counter(s)
ct = collections.Counter(t)

slist = cs.values()
tlist = ct.values()

slist.sort()
tlist.sort()

if slist == tlist:
    print("Yes")
else:
    print("No")



Fixed code:
import collections

s = list(input())
t = list(input())

cs = collections.Counter(s)
ct = collections.Counter(t)

slist = list(cs.values())
tlist = list(ct.values())

slist.sort()
tlist.sort()

if slist == tlist:
    print("Yes")
else:
    print("No")