def main():

    from itertools import accumulate

    n, *ab = list(map(int, open(0).read().split()))

    c = list(zip(*[iter(ab)] * 2))

    c.sort(key=lambda x: (x[1], x[0]))

    d, f = list(zip(*c))

    for i, j in zip(accumulate(d), f):

        if i > j:

            print('No')

            break

    else:

        print('Yes')





if __name__ == '__main__':

    main()

def main():

    from itertools import accumulate

    n, *ab = list(map(int, open(0).read().split()))

    c = list(zip(*[iter(ab)] * 2))

    c.sort(key=lambda x: (x[1], x[0]))

    t = 0

    for i, j in c:

        t += i

        if t > j:

            print('No')

            break

    else:

        print('Yes')





if __name__ == '__main__':

    main()

def main():
    from itertools import accumulate

    n, *ab = list(map(int, open(0).read().split()))
    c = list(zip(*[iter(ab)] * 2))
    c.sort(key=lambda x: (x[1], x[0]))
    d, f = list(zip(*c))
    for i, j in zip(accumulate(d), f):
        if i > j:
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

def main():
    from itertools import accumulate

    n, *ab = list(map(int, open(0).read().split()))
    c = list(zip(*[iter(ab)] * 2))
    c.sort(key=lambda x: (x[1], x[0]))
    t = 0
    for i, j in c:
        t += i
        if t > j:
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

-    d, f = list(zip(*c)) -    for i, j in zip(accumulate(d), f): -        if i > j: +    t = 0 +    for i, j in c: +        t += i +        if t > j: