#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); map mp; for(auto &&[x, y] : a){ cin >> x >> y; mp[x]++; mp[y]++; } for(auto &&[x, y] : a){ if(!(mp[x] == 1 || mp[y] == 1 || (x == y && mp[x] == 2))){ cout << "No\n"; return 0; } } cout << "Yes\n"; }