N = int(eval(input()))

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



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



sum_a = 0

for a, b in AB:

  sum_a += a

  if sum_a > b:

    print("No")

    exit()

print("Yes")
import sys

input = sys.stdin.buffer.readline



N = int(eval(input()))

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



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



sum_a = 0

for a, b in AB:

  sum_a += a

  if sum_a > b:

    print("No")

    exit()

print("Yes")
N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
sum_a = 0
for a, b in AB:
    sum_a += a
    if sum_a > b:
        print("No")
        exit()
print("Yes")

import sys

input = sys.stdin.buffer.readline
N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
sum_a = 0
for a, b in AB:
    sum_a += a
    if sum_a > b:
        print("No")
        exit()
print("Yes")

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