print("YES"if sorted(list(input()))==sorted(list(input()))else"NO")