# 2019/12/28 print('YES' if sorted(input())==sorted(input()) else 'NO')