n = int(input()) total = 0 AB = [] for i in range(n): a, b = map(int, input().split()) AB.append((a, b)) total += a AB.sort(key=lambda x:(-x[1], -x[0])) for a, b in AB: if b < total-a: print('NO') exit() total -= a print('YES')