def main(): A = input() B = input() if sorted(A) == sorted(B): ans = 'YES' else: ans = 'NO' print(ans) main()