# -*- coding: utf-8 -*- a = sorted(input()) b = sorted(input()) print('YES') if a == b else print('NO')