str = readlines.map(&:chars).map(&:sort) puts str[0] == str[1] ? "YES" : "NO"