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