#include <bits/stdc++.h>
using namespace std;
long long INF = 4e18;
int x[(int)1e5 + 100];
int k[(int)1e5 + 100];
map<pair<int, int>, int> saw;
int main() {
  ios_base::sync_with_stdio(false);
  vector<pair<int, int> > V;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> k[i];
  }
  int f = 1;
  for (int i = 0; i < n; ++i) {
    if (x[i] != 0) {
      if (saw.count(make_pair(x[i] - 1, k[i])) == 0) f = 0;
    }
    saw[make_pair(x[i], k[i])]++;
  }
  cout << (f ? "YES" : "NO") << endl;
  return 0;
}
