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