Buggy python submission (verdict: Time Limit Exceeded):
def main(S, T):
    S = list(S)
    T = list(T)
    if S == T:
        return "Yes"
    l = len(S)
    for i in range(l):
        s = S[i]
        t = T[i]
        if s != t:
            for j in range(l):
                if S[j] == s:
                    S[j] = t
                elif S[j] == t:
                    S[j] = s
            #print("%s -> %s"%(s, t), "".join(S))
    return "Yes" if S == T else "No"

assert main("chokudai", "redcoder") == "No"
assert main("azzel", "apple") == "Yes"
assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
S = input()
T = input()
print(main(S, T))


Fixed submission:
import sys
import collections

def main(S, T):
    print(S, file=sys.stderr)
    print(T, file=sys.stderr)

    m = dict()
    for s, t in zip(S, T):
        if s in m and m[s] != t:
            return "No"
        m[s] = t
    print("  ".join(m), file=sys.stderr)
    print("  ".join(m.values()), file=sys.stderr)
    c = set()
    for t in m.values():
        if t in c:
            return "No"
        c.add(t)
    return "Yes" 

assert main("chokudai", "redcoder") == "No"
assert main("azzel", "apple") == "Yes"
assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
S = input()
T = input()
print(main(S, T))

Buggy python submission (verdict: Runtime Error):
def main(S, T):
    cs = dict()

    for i, s in enumerate(S):
        t = T[i]
        if s != t:
            if t not in cs:
                cs[t] = s
            elif cs[t] == s:
                continue
            else:
                return "No"
    return "Yes"

if __name__ == "__main__":
    #assert main("azzel", "apple") == "Yes"
    #assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
    #assert main("chokudai", "redcoder") == "No"
    S = input()
    T = input()
    print(main())


Fixed submission:
import sys
import collections

def main(S, T):
    print(S, file=sys.stderr)
    print(T, file=sys.stderr)

    m = dict()
    for s, t in zip(S, T):
        if s in m and m[s] != t:
            return "No"
        m[s] = t
    print("  ".join(m), file=sys.stderr)
    print("  ".join(m.values()), file=sys.stderr)
    c = set()
    for t in m.values():
        if t in c:
            return "No"
        c.add(t)
    return "Yes" 

assert main("chokudai", "redcoder") == "No"
assert main("azzel", "apple") == "Yes"
assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
S = input()
T = input()
print(main(S, T))

Buggy python submission (verdict: Runtime Error):
def main(S, T):
    cs = dict()

    for i, s in enumerate(S):
        t = T[i]
        if s != t:
            if t not in cs:
                cs[t] = s
            elif cs[t] == s:
                continue
            else:
                return "No"
    return "Yes"

if __name__ == "__main__":

    S = input()
    T = input()
    print(main())


Fixed submission:
import sys
import collections

def main(S, T):
    print(S, file=sys.stderr)
    print(T, file=sys.stderr)

    m = dict()
    for s, t in zip(S, T):
        if s in m and m[s] != t:
            return "No"
        m[s] = t
    print("  ".join(m), file=sys.stderr)
    print("  ".join(m.values()), file=sys.stderr)
    c = set()
    for t in m.values():
        if t in c:
            return "No"
        c.add(t)
    return "Yes" 

assert main("chokudai", "redcoder") == "No"
assert main("azzel", "apple") == "Yes"
assert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"
S = input()
T = input()
print(main(S, T))