#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    mp[a] = a + b;
  }
  for (auto x : mp) {
    if (mp[x.second] == x.first and x.first != x.second) {
      cout << "YES";
      return;
    }
  }
  cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
