N = int(eval(input()))

ab = [list(map(int, input().split())) for _ in range(N)]

time = 0

ab = sorted(ab, key=lambda x:x[1])

for a, b in ab:

  time += a

  if time <= b:

    pass

  else:

    print('No')

    exit()

print('Yes')
import sys

input = sys.stdin.readline



N = int(eval(input()))

ab = [list(map(int, input().split())) for _ in range(N)]

ab = sorted(ab, key=lambda x:x[1])

now = 0

for a, b in ab:

  if now + a <= b:

    now += a

  else:

    print('No')

    exit()

print('Yes')
N = int(eval(input()))
ab = [list(map(int, input().split())) for _ in range(N)]
time = 0
ab = sorted(ab, key=lambda x: x[1])
for a, b in ab:
    time += a
    if time <= b:
        pass
    else:
        print("No")
        exit()
print("Yes")

import sys

input = sys.stdin.readline
N = int(eval(input()))
ab = [list(map(int, input().split())) for _ in range(N)]
ab = sorted(ab, key=lambda x: x[1])
now = 0
for a, b in ab:
    if now + a <= b:
        now += a
    else:
        print("No")
        exit()
print("Yes")

+import sys + +input = sys.stdin.readline -time = 0 +now = 0 -    time += a -    if time <= b: -        pass +    if now + a <= b: +        now += a