# -*- coding: utf-8 -*- A = raw_input() B = raw_input() print ( "YES" if sorted(A) == sorted(B) else "NO")