x = sorted(input()) y = sorted(input()) if x == y: print('YES') else: print('NO')