a = sorted(input())
b = sorted(input())
if a == b:
    print('YES')
else:
    print('NO')