#include <iostream>
#include <cstdio>
#include <stack>
using namespace std;
int main()
{
int map[200001];
int n;
int hus, wif;
while (cin >> n && n) {
for (int i = 0; i < n; ++i) {
scanf("%d %d", &hus, &wif);
map[hus] = wif;
}
stack<int> couple;
for (int j = 1; j <= 2 * n; ++j) {
if (!couple.empty()) {
if (map[couple.top()] == j) {
couple.pop();
continue;
}
}
couple.push(j);
}
if (couple.empty()) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
return 0;
}