base = str(input()) diff = str(input()) if sorted(base) == sorted(diff): print('YES') else: print('NO')