#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long expo_pow(long long x, long long y) {
  if (y == 0) return 1;
  y = y % (mod - 1);
  x %= mod;
  if (y == 0) y = mod - 1;
  long long res = 1;
  while (y) {
    if (y & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    y >>= 1;
  }
  return res;
}
long long add() { return 0; }
template <typename T, typename... Types>
T add(T var1, Types... var2) {
  return (((((long long)(var1)) % mod + (long long)(add(var2...))) % mod) +
          mod) %
         mod;
}
long long mul() { return 1; }
template <typename T, typename... Types>
T mul(T var1, Types... var2) {
  return (((long long)(var1)) % mod * (long long)(mul(var2...))) % mod;
}
void solve() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
  map<pair<long long, long long>, bool> mp;
  for (long long i = 0; i < n; ++i) {
    long long cur_x = a[i].first;
    long long cur_k = a[i].second;
    if (cur_x == 0) {
      mp[{cur_x, cur_k}] = 1;
    } else {
      if (mp[{cur_x - 1, cur_k}] != 1) {
        cout << "NO\n";
        return;
      }
      mp[{cur_x, cur_k}] = 1;
    }
  }
  cout << "YES\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  long long i = 1;
  while (test--) {
    solve();
  }
}
