a = sorted(list(*input().split())) b = sorted(list(*input().split())) if a == b: print("YES") else: print("NO")