s = input() t = input() s.sort() t.sort() print("YES" if s == t else "NO")