a = str(input()) b = str(input()) if sorted(a) == sorted(b): print('YES') else: print('NO')