def main(): a = list(input()) b = list(input()) print(a) i = 0 j = 0 while i < len(a): if len(b) == 0: print("YES") break while j < len(b): if a[i] == b[j]: a.pop(i) b.pop(j) break j += 1 i += 1 if len(b) != 0: print("NO") if __name__ == "__main__": main()