n = int(eval(input()))

ab = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x: (x[1], x[0]))

tt = 0

for i in ab:

    tt += i[0]

    if tt > i[1]:

        print("No")

        exit()

print("Yes")

def main():

    import sys

    input = sys.stdin.readline

    n = int(input().rstrip('\n'))

    ab = [list(map(int, input().rstrip('\n').split())) for _ in range(n)]

    ab = sorted(ab, key=lambda x: x[1])

    t = 0

    for a, b in ab:

        t += a

        if t > b:

            print("No")

            exit()

    print("Yes")





if __name__ == '__main__':

    main()

n = int(eval(input()))
ab = sorted(
    [list(map(int, input().split())) for _ in range(n)], key=lambda x: (x[1], x[0])
)
tt = 0
for i in ab:
    tt += i[0]
    if tt > i[1]:
        print("No")
        exit()
print("Yes")

def main():
    import sys

    input = sys.stdin.readline
    n = int(input().rstrip("\n"))
    ab = [list(map(int, input().rstrip("\n").split())) for _ in range(n)]
    ab = sorted(ab, key=lambda x: x[1])
    t = 0
    for a, b in ab:
        t += a
        if t > b:
            print("No")
            exit()
    print("Yes")


if __name__ == "__main__":
    main()

-n = int(eval(input())) -ab = sorted( -    [list(map(int, input().split())) for _ in range(n)], key=lambda x: (x[1], x[0]) -) -tt = 0 -for i in ab: -    tt += i[0] -    if tt > i[1]: -        print("No") -        exit() -print("Yes") +def main(): +    import sys + +    input = sys.stdin.readline +    n = int(input().rstrip("\n")) +    ab = [list(map(int, input().rstrip("\n").split())) for _ in range(n)] +    ab = sorted(ab, key=lambda x: x[1]) +    t = 0 +    for a, b in ab: +        t += a +        if t > b: +            print("No") +            exit() +    print("Yes") + + +if __name__ == "__main__": +    main()