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