N = int(eval(input()))

AB = [[int(x) for x in input().split()] for _ in range(N)]

AB.sort(key=lambda x:(x[1],x[0]))

 

t = 0

ans = 'Yes'

for a,b in AB:

    t += a

    if t <= b:

        continue

    else:

        ans = 'No'

        break



print(ans)

import sys

input = sys.stdin.readline



N = int(eval(input()))

AB = [[int(x) for x in input().split()] for _ in range(N)]

AB.sort(key=lambda x:(x[1],x[0]))

 

t = 0

ans = 'Yes'

for a,b in AB:

    t += a

    if t <= b:

        continue

    else:

        ans = 'No'

        break



print(ans)



N = int(eval(input()))
AB = [[int(x) for x in input().split()] for _ in range(N)]
AB.sort(key=lambda x: (x[1], x[0]))
t = 0
ans = "Yes"
for a, b in AB:
    t += a
    if t <= b:
        continue
    else:
        ans = "No"
        break
print(ans)

import sys

input = sys.stdin.readline
N = int(eval(input()))
AB = [[int(x) for x in input().split()] for _ in range(N)]
AB.sort(key=lambda x: (x[1], x[0]))
t = 0
ans = "Yes"
for a, b in AB:
    t += a
    if t <= b:
        continue
    else:
        ans = "No"
        break
print(ans)

+import sys + +input = sys.stdin.readline