base = str(input()) diff = str(input()) if sum(bytearray(base.encode())) == sum(bytearray(diff.encode())): print('YES') else: print('NO')