s=sorted(list(input())) f=sorted(list(input())) if s==f: print('YES') else: print('NO')