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