Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    letter = []
    for i in range(len(S)):
        letter.append(T[i])                                                                                                                                                     
        if S[i] == T[i]:
            continue
        else:
            if S[i] in letter:
                break
            else:
                s = S[i]
                for j in range(len(S)):
                    if S[j] == s:
                        S[j] = T[i]
                    elif S[j] == T[i]:
                        S[j] = s

    if S == T:
        print('Yes')
    else:
        print('No')

Fixed submission:
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    start = [-1 for i in range(26)]
    stop = [-1 for i in range(26)]

    fail = False
    for i in range(len(S)):
        a = ord(S[i]) - ord('a')
        b = ord(T[i]) - ord('a')

        if start[a] != -1 or stop[b] != -1:
            if start[a] != b or stop[b] != a:
                print('No')
                fail = True
                break
        else:
            start[a] = b
            stop[b] = a

    if not fail:
        print('Yes')

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    letter = []
    for i in range(len(S)):
        letter.append(T[i])                                                                                                                                                     if S[i] == T[i]:
            continue
        else:
            if S[i] in letter:
                break
            else:
                s = S[i]
                for j in range(len(S)):
                    if S[j] == s:
                        S[j] = T[i]
                    elif S[j] == T[i]:
                        S[j] = s

    if S == T:
        print('Yes')
    else:
        print('No')

Fixed submission:
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    start = [-1 for i in range(26)]
    stop = [-1 for i in range(26)]

    fail = False
    for i in range(len(S)):
        a = ord(S[i]) - ord('a')
        b = ord(T[i]) - ord('a')

        if start[a] != -1 or stop[b] != -1:
            if start[a] != b or stop[b] != a:
                print('No')
                fail = True
                break
        else:
            start[a] = b
            stop[b] = a

    if not fail:
        print('Yes')

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    letter = []
    for i in range(len(S)):
        letter.append(T[i])                                                                                                                                                     if S[i] == T[i]:
            continue
        else:
            if S[i] in letter:
                break
            else:
                s = S[i]
                for j in range(len(S)):
                    if S[j] == s:
                        S[j] = T[i]
                    elif S[j] == T[i]:
                        S[j] = s

    if S == T:
        print('Yes')
    else:
        print('No')

Fixed submission:
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    start = [-1 for i in range(26)]
    stop = [-1 for i in range(26)]

    fail = False
    for i in range(len(S)):
        a = ord(S[i]) - ord('a')
        b = ord(T[i]) - ord('a')

        if start[a] != -1 or stop[b] != -1:
            if start[a] != b or stop[b] != a:
                print('No')
                fail = True
                break
        else:
            start[a] = b
            stop[b] = a

    if not fail:
        print('Yes')