Buggy python submission (verdict: Runtime Error):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    s = list(input())
    t = list(input())
    n = len(s)
    s_dict = defaultdict(int)
    t_dict = defaultdict(int)
    for i in range(n):
        s_dict[s[i]] += 1
        t_dict[t[i]] += 1

    print(s_dict)
    print(t_dict)

    if list(s_dict.values().sort()) == list(t_dict.values().sort()):
        print('Yes')
    else:
        print('No')
        

if  __name__=='__main__':
    main()


Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    s = list(input())
    t = list(input())
    n = len(s)
    s_dict = defaultdict(int)
    t_dict = defaultdict(int)
    for i in range(n):
        s_dict[s[i]] += 1
        t_dict[t[i]] += 1

    #print(s_dict)
    #print(t_dict)

    if sorted(list(s_dict.values()))== sorted(list(t_dict.values())):
        print('Yes')
    else:
        print('No')
        

if  __name__=='__main__':
    main()

Buggy python submission (verdict: Runtime Error):
azzel
apple

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    s = list(input())
    t = list(input())
    n = len(s)
    s_dict = defaultdict(int)
    t_dict = defaultdict(int)
    for i in range(n):
        s_dict[s[i]] += 1
        t_dict[t[i]] += 1

    #print(s_dict)
    #print(t_dict)

    if sorted(list(s_dict.values()))== sorted(list(t_dict.values())):
        print('Yes')
    else:
        print('No')
        

if  __name__=='__main__':
    main()