str_list = ['', ''] for i in range(2): str_list[i] = sorted(input()) if str_list[0] == str_list[1]: print("YES") else: print("NO")