str_a = input() str_b = input() list_a = list(str_a) list_b = list(str_b) can_rearrange = True for a, c_a in enumerate(list_a): for b, c_b in enumerate(list_b): if c_a == c_b: list_b[b] = " " break else: can_rearrange = False if can_rearrange: print("YES") else: print("NO")