import sys

from operator import itemgetter



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    W = [[int(w) for w in input().split()] for _ in range(N)]

    W.sort()

    W.sort(key = itemgetter(1))

    time = 0

    for i, w in enumerate(W):

        if time + w[0] > w[1]:

            print("No")

            break

        else:

            time += w[0]

    else: print("Yes")



    return 0



if __name__ == "__main__":

    solve()
import sys

from operator import itemgetter



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    work = [[int(i) for i in input().split()] for _ in range(N)]

    work.sort(key = itemgetter(1))

    currentTime = 0

    for i in range(N):

        a, b = work[i]

        if a + currentTime <= b:

            currentTime += a

        else:

            print("No")

            break

    else: print("Yes")



    return 0



if __name__ == "__main__":

    solve()
import sys
from operator import itemgetter


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    W = [[int(w) for w in input().split()] for _ in range(N)]
    W.sort()
    W.sort(key=itemgetter(1))
    time = 0
    for i, w in enumerate(W):
        if time + w[0] > w[1]:
            print("No")
            break
        else:
            time += w[0]
    else:
        print("Yes")
    return 0


if __name__ == "__main__":
    solve()

import sys
from operator import itemgetter


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    work = [[int(i) for i in input().split()] for _ in range(N)]
    work.sort(key=itemgetter(1))
    currentTime = 0
    for i in range(N):
        a, b = work[i]
        if a + currentTime <= b:
            currentTime += a
        else:
            print("No")
            break
    else:
        print("Yes")
    return 0


if __name__ == "__main__":
    solve()

-    W = [[int(w) for w in input().split()] for _ in range(N)] -    W.sort() -    W.sort(key=itemgetter(1)) -    time = 0 -    for i, w in enumerate(W): -        if time + w[0] > w[1]: +    work = [[int(i) for i in input().split()] for _ in range(N)] +    work.sort(key=itemgetter(1)) +    currentTime = 0 +    for i in range(N): +        a, b = work[i] +        if a + currentTime <= b: +            currentTime += a +        else: -        else: -            time += w[0]