#include <bits/stdc++.h>
using namespace std;
int gcd(int u, int v) { return (v != 0) ? gcd(v, u % v) : u; }
int main() {
  set<pair<int, int> > s;
  int n;
  cin >> n;
  int x, y;
  bool flag = 1;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x == 0)
      s.insert(make_pair(x, y));
    else if (!s.count(make_pair(x - 1, y)))
      flag = 0;
    s.insert(make_pair(x, y));
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
