N = int(eval(input()))

X=[0]*N

for i in range(N):

    X[i] = list(map(int, input().split()))

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

def check():

    now = 0

    for i in range(N):

        now += X[i][0]

        if now > X[i][1]:

            return 'No'

    return 'Yes'

print((check()))
def check():

    N = int(eval(input()))

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

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

    now = 0

    for a,b in X:

        now += a

        if now>b:

            return 'No'

    return 'Yes'

print((check()))
N = int(eval(input()))
X = [0] * N
for i in range(N):
    X[i] = list(map(int, input().split()))
X.sort(key=lambda x: x[1])


def check():
    now = 0
    for i in range(N):
        now += X[i][0]
        if now > X[i][1]:
            return "No"
    return "Yes"


print((check()))

def check():
    N = int(eval(input()))
    X = [list(map(int, input().split())) for _ in range(N)]
    X.sort(key=lambda x: x[1])
    now = 0
    for a, b in X:
        now += a
        if now > b:
            return "No"
    return "Yes"


print((check()))

-N = int(eval(input())) -X = [0] * N -for i in range(N): -    X[i] = list(map(int, input().split())) -X.sort(key=lambda x: x[1]) - - +    N = int(eval(input())) +    X = [list(map(int, input().split())) for _ in range(N)] +    X.sort(key=lambda x: x[1]) -    for i in range(N): -        now += X[i][0] -        if now > X[i][1]: +    for a, b in X: +        now += a +        if now > b: