print('YES' if set(input()) == set(input()) else 'NO')