N=int(eval(input()))

BA=[[0,0] for _ in range(N)]



for i in range(N):

    BA[i][1],BA[i][0]=list(map(int,input().split()))

BA.sort()



t=0

ans="Yes"

for i in range(N):

    t+=BA[i][1]

    if t>BA[i][0]:

        ans="No"

        break

print(ans)
import sys

input = sys.stdin.readline



def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    N=I()

    Q=[]

    for _ in range(N):

        a,b=MI()

        Q.append([b,a])

        

    Q.sort()

    now=0

    flag=1

    for i in range(N):

        b,a=Q[i]

        now+=a

        if now>b:

            flag=0

            break

            

    if flag:

        print("Yes")

    else:

        print("No")

        



main()

N = int(eval(input()))
BA = [[0, 0] for _ in range(N)]
for i in range(N):
    BA[i][1], BA[i][0] = list(map(int, input().split()))
BA.sort()
t = 0
ans = "Yes"
for i in range(N):
    t += BA[i][1]
    if t > BA[i][0]:
        ans = "No"
        break
print(ans)

import sys

input = sys.stdin.readline


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    N = I()
    Q = []
    for _ in range(N):
        a, b = MI()
        Q.append([b, a])
    Q.sort()
    now = 0
    flag = 1
    for i in range(N):
        b, a = Q[i]
        now += a
        if now > b:
            flag = 0
            break
    if flag:
        print("Yes")
    else:
        print("No")


main()

-N = int(eval(input())) -BA = [[0, 0] for _ in range(N)] -for i in range(N): -    BA[i][1], BA[i][0] = list(map(int, input().split())) -BA.sort() -t = 0 -ans = "Yes" -for i in range(N): -    t += BA[i][1] -    if t > BA[i][0]: -        ans = "No" -        break -print(ans) +import sys + +input = sys.stdin.readline + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    N = I() +    Q = [] +    for _ in range(N): +        a, b = MI() +        Q.append([b, a]) +    Q.sort() +    now = 0 +    flag = 1 +    for i in range(N): +        b, a = Q[i] +        now += a +        if now > b: +            flag = 0 +            break +    if flag: +        print("Yes") +    else: +        print("No") + + +main()