print('YES' if sorted(input())==sorted(input()) else 'NO') #print((a[n//2]+a[~(n//2)])/2)