#include<iostream> #include<string> #include<stdlib.h> using namespace std; void main(){ int n; while(cin>>n&&n){ string str1[1000],str2[1000]; int k=n; string str11,str22; if(n==1) { cin>>str11>>str22; cout<<"Yes"<<endl; continue; } int z1=1; int z2=1; for(int i=0;i<n;++i){ if(i==0) { cin>>str1[0]>>str2[0]; } else{ cin>>str11; cin>>str22; bool t1=true; bool t2=true; bool t3=false; bool t4=false; for(int j=0;j<i;++j){ if(!t3&&str11==str1[j]) { t1=false; t3=true; } if(!t4&&str22==str2[j]) { t2=false; t4=true; } if(t4&&t3) break; } if(t1) str1[z1++]=str11; if(t2) str2[z2++]=str22; } } bool tt[1000]; memset(tt,true,sizeof(tt)); for(int a=0;a<z1;++a){ for(int b=0;b<z2;++b){ if(str1[a]==str2[b]) { tt[a]=false; break; } } } int count=0; for(int fff=0;fff<z1;++fff){ if(tt[fff]) ++count; } if(count==1) cout<<"Yes"<<endl; else cout<<"No"<<endl; } }