Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())
pair = []
li =[]
ans = "Yes"

for i in range(len(s)):
    if [s[i],t[i]] in li:
        pass
    else:
        li.append([s[i],t[i]])

def check2(pair,i,li):
    for j in range(len(pair)):
        if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):
            return False
    return True

for i in range(len(s)):
    if check2(pair,i,li):
        pair.append([li[i][0],li[i][1]])
    else:
        ans = "No"
        break

print(ans)


Fixed submission:
s = list(input())
t = list(input())
pair = []
li =[]
ans = "Yes"

for i in range(len(s)):
    if [s[i],t[i]] in li:
        pass
    else:
        li.append([s[i],t[i]])

def check2(pair,i,li):
    for j in range(len(pair)):
        if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):
            return False
    return True

for i in range(len(li)):
    if check2(pair,i,li):
        pair.append([li[i][0],li[i][1]])
    else:
        ans = "No"
        break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())
pair = []
ans = "Yes"

def check(pair,i,s,t):
    for j in range(len(pair)):
        if s!=pair[j][0] and s!=pair[j][1] and t!=pair[j][0] and t!=pair[j][1]:
            pass
        elif s==pair[j][0] and t==pair[j][1]:
            pass
        elif s==pair[j][1] or t==pair[j][0]:
            pass
        else:
            return False
    return True

def check2(pair,i,s,t):
    for j in range(len(pair)):
        if (s==pair[j][0] and t!=pair[j][1])or(s!=pair[j][0] and t==pair[j][1]):
            return False
    return True

for i in range(len(s)):
    if check2(pair,i,s[i],t[i]):
        pair.append([s[i],t[i]])
    else:
        ans = "No"
        break

print(ans)


Fixed submission:
s = list(input())
t = list(input())
pair = []
li =[]
ans = "Yes"

for i in range(len(s)):
    if [s[i],t[i]] in li:
        pass
    else:
        li.append([s[i],t[i]])

def check2(pair,i,li):
    for j in range(len(pair)):
        if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):
            return False
    return True

for i in range(len(li)):
    if check2(pair,i,li):
        pair.append([li[i][0],li[i][1]])
    else:
        ans = "No"
        break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())
pair = []
ans = "Yes"

def check(pair,i,s,t):
    for j in range(len(pair)):
        if s!=pair[j][0] and s!=pair[j][1] and t!=pair[j][0] and t!=pair[j][1]:
            pass
        elif s==pair[j][0] and t==pair[j][1]:
            pass
        elif s==pair[j][1] or t==pair[j][0]:
            pass
        else:
            return False
    return True

for i in range(len(s)):
    if check(pair,i,s[i],t[i]):
        pair.append([s[i],t[i]])
    else:
        ans = "No"
        break

print(ans)


Fixed submission:
s = list(input())
t = list(input())
pair = []
li =[]
ans = "Yes"

for i in range(len(s)):
    if [s[i],t[i]] in li:
        pass
    else:
        li.append([s[i],t[i]])

def check2(pair,i,li):
    for j in range(len(pair)):
        if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):
            return False
    return True

for i in range(len(li)):
    if check2(pair,i,li):
        pair.append([li[i][0],li[i][1]])
    else:
        ans = "No"
        break

print(ans)