i=input s=sorted print(('NO','YES')[s(i())==s(i())])