import sys

from collections import defaultdict

from operator import itemgetter

input = sys.stdin.readline



N = int(eval(input()))

d = defaultdict(int)

for _ in range(N):

    a, b = list(map(int, input().split()))

    d[b] += a

task = list(d.items())

task.sort()



now = 0

ans = "Yes"

for limit, time in task:

    now += time

    if now > limit:

        ans = "No"

        break



print(ans)

import sys

input = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 7)





def main():

    N = int(eval(input()))

    work = []  # due, duration

    for _ in range(N):

        a, b = list(map(int, input().split()))

        work.append((b, -a))

    work.sort()



    now = 0

    for b, a in work:

        now = now - a

        if now > b:

            return "No"

    return "Yes"





if __name__ == "__main__":

    print((main()))
import sys
from collections import defaultdict
from operator import itemgetter

input = sys.stdin.readline
N = int(eval(input()))
d = defaultdict(int)
for _ in range(N):
    a, b = list(map(int, input().split()))
    d[b] += a
task = list(d.items())
task.sort()
now = 0
ans = "Yes"
for limit, time in task:
    now += time
    if now > limit:
        ans = "No"
        break
print(ans)

import sys

input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)


def main():
    N = int(eval(input()))
    work = []  # due, duration
    for _ in range(N):
        a, b = list(map(int, input().split()))
        work.append((b, -a))
    work.sort()
    now = 0
    for b, a in work:
        now = now - a
        if now > b:
            return "No"
    return "Yes"


if __name__ == "__main__":
    print((main()))

-from collections import defaultdict -from operator import itemgetter -input = sys.stdin.readline -N = int(eval(input())) -d = defaultdict(int) -for _ in range(N): -    a, b = list(map(int, input().split())) -    d[b] += a -task = list(d.items()) -task.sort() -now = 0 -ans = "Yes" -for limit, time in task: -    now += time -    if now > limit: -        ans = "No" -        break -print(ans) +input = sys.stdin.buffer.readline +sys.setrecursionlimit(10**7) + + +def main(): +    N = int(eval(input())) +    work = []  # due, duration +    for _ in range(N): +        a, b = list(map(int, input().split())) +        work.append((b, -a)) +    work.sort() +    now = 0 +    for b, a in work: +        now = now - a +        if now > b: +            return "No" +    return "Yes" + + +if __name__ == "__main__": +    print((main()))