a = list(input()) b = list(input()) if a.sort() == b.sort(): print("YES") else: print("NO")