#include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) #define rrep(i, s, t) for(ll i = (ll)(t) - 1; i >= (ll)(s); i--) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define TT template TT using vec = vector; template bool chmin(T1 &x, T2 y) { return x > y ? (x = y, true) : false; } template bool chmax(T1 &x, T2 y) { return x < y ? (x = y, true) : false; } struct io_setup { io_setup() { ios::sync_with_stdio(false); std::cin.tie(nullptr); cout << fixed << setprecision(15); } } io_setup; void solve(){ int N; cin>>N; vectorS(N),T(N); mapmp; rep(i,0,N){ cin>>S[i]>>T[i]; mp[S[i]]++; mp[T[i]]++; } rep(i,0,N){ if(mp[S[i]]>1&&mp[T[i]]>1){ cout<<"No\n"; return; } } cout<<"Yes\n"; } int main() { solve(); }