#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector> a(n); for(auto &&[s, t] : a) cin >> s >> t; sort(a.begin(), a.end()); for(int i = 0; i < n; ){ int p = i; while(i < n && a[p].first == a[i].first) i++; for(int j = p; j + 1 < i; j++){ if(a[j].second != a[j + 1].second){ cout << "No\n"; return 0; } } } cout << "Yes\n"; }