N = int(eval(input()))

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



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



now = 0

for a, b in ab:

	if b < now + a:

		print("No")

		break

	else:

		now += a

else:

	print("Yes")

from operator import itemgetter as ig

# 定数

INF = float("inf")

MOD = int(1e9 + 7)



# エントリーポイント

def main():

    N = int(eval(input()))

    AB = (tuple(map(int, input().split())) for _ in range(N))

    ab = sorted(AB, key=ig(1))

    sum_a = 0

    for a, b in ab:

        sum_a += a

        if b < sum_a:

            print("No")

            break

    else:

        print("Yes")



main()

N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
ab = sorted(AB, key=lambda x: (x[1], x[0]))
now = 0
for a, b in ab:
    if b < now + a:
        print("No")
        break
    else:
        now += a
else:
    print("Yes")

from operator import itemgetter as ig

# 定数
INF = float("inf")
MOD = int(1e9 + 7)
# エントリーポイント
def main():
    N = int(eval(input()))
    AB = (tuple(map(int, input().split())) for _ in range(N))
    ab = sorted(AB, key=ig(1))
    sum_a = 0
    for a, b in ab:
        sum_a += a
        if b < sum_a:
            print("No")
            break
    else:
        print("Yes")


main()

-N = int(eval(input())) -AB = [list(map(int, input().split())) for _ in range(N)] -ab = sorted(AB, key=lambda x: (x[1], x[0])) -now = 0 -for a, b in ab: -    if b < now + a: -        print("No") -        break +from operator import itemgetter as ig + +# 定数 +INF = float("inf") +MOD = int(1e9 + 7) +# エントリーポイント +def main(): +    N = int(eval(input())) +    AB = (tuple(map(int, input().split())) for _ in range(N)) +    ab = sorted(AB, key=ig(1)) +    sum_a = 0 +    for a, b in ab: +        sum_a += a +        if b < sum_a: +            print("No") +            break -        now += a -else: -    print("Yes") +        print("Yes") + + +main()