n = int(eval(input()))

d = dict()

for i in range(n):

    w, t = list(map(int, input().split()))

    if t in d:

        d[t] = d[t] + w

    else:

        d[t] = w

d = sorted(list(d.items()), key=lambda x:x[0])

now = 0

ans = True

for x in d:

    t, w = x

    now = now + w

    if now > t:

        ans = False

        break

print(('Yes' if ans else 'No'))
import sys

input = sys.stdin.readline

n = int(eval(input()))

d = dict()

for i in range(n):

    w, t = list(map(int, input().split()))

    if t in d:

        d[t] = d[t] + w

    else:

        d[t] = w

d = sorted(list(d.items()), key=lambda x:x[0])

now = 0

ans = True

for x in d:

    t, w = x

    now = now + w

    if now > t:

        ans = False

        break

print(('Yes' if ans else 'No'))
n = int(eval(input()))
d = dict()
for i in range(n):
    w, t = list(map(int, input().split()))
    if t in d:
        d[t] = d[t] + w
    else:
        d[t] = w
d = sorted(list(d.items()), key=lambda x: x[0])
now = 0
ans = True
for x in d:
    t, w = x
    now = now + w
    if now > t:
        ans = False
        break
print(("Yes" if ans else "No"))

import sys

input = sys.stdin.readline
n = int(eval(input()))
d = dict()
for i in range(n):
    w, t = list(map(int, input().split()))
    if t in d:
        d[t] = d[t] + w
    else:
        d[t] = w
d = sorted(list(d.items()), key=lambda x: x[0])
now = 0
ans = True
for x in d:
    t, w = x
    now = now + w
    if now > t:
        ans = False
        break
print(("Yes" if ans else "No"))

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