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

def c(a,b,s,t):
    li=""
    j=0
    for i in s:
        if i==a:
            li+=b
            if t[j]!=b:
                print("No")
                sys.exit()
        elif i==b:
            li+=a
        else:
            li+=i
        j+=1
    return li
    

for i in range(len(t)):
    if s[i]!=t[i]:
        s=c(s[i],t[i],s,t)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import sys
s=input()
t=input()

def c(a,b,s,t):
    li=""
    j=0
    for i in s:
        if i==a:
            li+=b
            if t[j]!=b:
                print("No")
                sys.exit()
        elif i==b:
            li+=a
        else:
            li+=i
        j+=1
    return li
    

for i in range(len(t)):
    if s[i]!=t[i]:
        l.append(t[i])
        s=c(s[i],t[i],s,t)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

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

def c(a,b,s,t):
    li=""
    j=0
    for i in s:
        if i==a:
            li+=b
            if t[j]!=b:
                print("No")
                sys.exit()
        elif i==b:
            li+=a
        else:
            li+=i
        j+=1
    return li
    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                print("No")
                sys.exit()
        l.append(t[i])
        s=c(s[i],t[i],s,t)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

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

def c(a,b,s):
    li=""
    for i in s:
        if i==a:
            li+=b
        elif i==b:
            li+=a
        else:
            li+=i
    return li
    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                print("No")
                sys.exit()
        l.append(t[i])
        s=c(s[i],t[i],s)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

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


    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                print("No")
                sys.exit()
        l.append(t[i])
        u=s.replace(s[i],"A")
        v=u.replace(t[i],s[i])
        s=v.replace("A",t[i])
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

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

def c(a,b,s):
    t=s.replace(a,"A")
    u=t.replace(b,a)
    v=u.replace("A",b)
    
    return v
    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                print("No")
                sys.exit()
        l.append(t[i])
        s=c(s[i],t[i],s)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

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

def c(a,b,s):
    t=s.replace(a,"A")
    u=t.replace(b,a)
    v=u.replace("A",b)
    
    return v
    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                print("No")
                sys.exit()
        l.append(t[i])
        s=c(s[i],t[i],s)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()

def c(a,b,s):
    t=s.replace(a,"A")
    u=t.replace(b,a)
    v=u.replace("A",b)
    
    return v
    
l=[]

for i in range(len(t)):
    if s[i]!=t[i]:
        for j in l:
            if s[i]==j:
                break
        l.append(t[i])
        s=c(s[i],t[i],s)
    
        

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()

def c(a,b,s):
    t=s.replace(a,".")
    u=t.replace(b,a)
    v=u.replace(".",b)
    
    return v
    

for i in range(len(t)):
    if s[i]!=t[i]:
        s=c(s[i],t[i],s)

if s==t:
    print("Yes")
else:
    print("No")
        
    

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


def f(s):
    l=[]
    a="abcdefghijklmnopqrstuvwxyz"
    r=""
    for i in range(len(s)):
        if s[i] in l:
            for j in range(len(l)):
                if s[i]==l[j]:
                    r+=a[j]
        else:
            r+=a[len(l)]
            l.append(s[i])
    return r

if f(s)==f(t):
    print("Yes")
else:
    print("No")