a = set(input()) b = set(input()) if a == b: print("YES") else: print("NO")