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