N = int(eval(input()))

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



AB = sorted(AB, key=lambda x: x[1]-x[0]) # B-Aが小さい順にソート

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

t = 0



for i in range(N):

    if t <= AB[i][1] - AB[i][0]: # B-A以下のとき

        t += AB[i][0]

        continue

    else:

        print('No')

        break

else:

    if t <= AB[N-1][1]:

        print('Yes')

    else:

        print('No')



N = int(eval(input()))

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



# AB = sorted(AB, key=lambda x: x[1]-x[0]) # B-Aが小さい順にソート

AB = sorted(AB, key=lambda x: x[1]) # B-Aが同じ値の時はBが小さい順に並び替え

t = 0



for i in range(N):

    if t <= AB[i][1] - AB[i][0]: # B-A以下のとき

        t += AB[i][0]

        continue

    else:

        print('No')

        break

else:

    if t <= AB[N-1][1]:

        print('Yes')

    else:

        print('No')



N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x: x[1] - x[0])  # B-Aが小さい順にソート
AB = sorted(AB, key=lambda x: x[1])
t = 0
for i in range(N):
    if t <= AB[i][1] - AB[i][0]:  # B-A以下のとき
        t += AB[i][0]
        continue
    else:
        print("No")
        break
else:
    if t <= AB[N - 1][1]:
        print("Yes")
    else:
        print("No")

N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
# AB = sorted(AB, key=lambda x: x[1]-x[0]) # B-Aが小さい順にソート
AB = sorted(AB, key=lambda x: x[1])  # B-Aが同じ値の時はBが小さい順に並び替え
t = 0
for i in range(N):
    if t <= AB[i][1] - AB[i][0]:  # B-A以下のとき
        t += AB[i][0]
        continue
    else:
        print("No")
        break
else:
    if t <= AB[N - 1][1]:
        print("Yes")
    else:
        print("No")

-AB = sorted(AB, key=lambda x: x[1] - x[0])  # B-Aが小さい順にソート -AB = sorted(AB, key=lambda x: x[1]) +# AB = sorted(AB, key=lambda x: x[1]-x[0]) # B-Aが小さい順にソート +AB = sorted(AB, key=lambda x: x[1])  # B-Aが同じ値の時はBが小さい順に並び替え