*a, = sorted(input()) *b, = sorted(input()) print("YES" if a==b else "NO")