a = sorted(list(input())) b = sorted(list(input())) print(["NO","YES"][a==b])