a = sorted(input()) b = sorted(input()) print(['NO', 'YES'][a == b])