#include using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define ll long long const long long mod=998244353; const long long hmod=46216567629137; int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); int N; cin>>N; bool ok[N+1]; for(int i=1;i<=N;i++) ok[i]=0; mapdat; string S[N+1],T[N+1]; for(int i=1;i<=N;i++){ cin>>S[i]>>T[i]; if(dat.count(S[i])>=1) dat[S[i]]++; else dat[S[i]]=1; if(dat.count(T[i])>=1) dat[T[i]]++; else dat[T[i]]=1; } for(int i=1;i<=N;i++){ if(dat[S[i]]==1) ok[i]=1; if(dat[T[i]]==1) ok[i]=1; if(!ok[i]){ cout<<"No\n"; return 0; } } cout<<"Yes\n"; }