#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> fr;
int main() {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  for (int k = 0; k < N; k++) {
    int a, b;
    cin >> a >> b;
    fr[make_pair(a, b)]++;
    if (a == 0) continue;
    if (!fr.count(make_pair(a - 1, b))) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
