#include<iostream> #include<cstdio> using namespace std; const int maxn = 100010; int father[maxn],vis[maxn]; int flag = 0; int Find(int x){ while(x != father[x]){ // father[x] = father[father[x]]; x = father[x]; } return x; } void Union(int a,int b){ int ax = Find(a); int bx = Find(b); if(ax != bx) father[ax] = bx; else flag = 0; } int main(){ int a,b; while(cin>>a>>b){ if(a == -1 && b == -1) break; if(a == 0 && b == 0){ cout<<"Yes"<<endl; continue; } for(int i = 1; i < maxn; i++){ father[i] = i; vis[i] = 0; } vis[a] = vis[b] = 1; flag = 1; Union(a,b); while(cin>>a>>b){ if(a == 0 && b == 0) break; vis[a] = vis[b] = 1; Union(a,b); } int sum = 0; for(int i = 1; i < maxn; i++){ if(vis[i] && father[i] == i) sum++; if(sum > 1){ flag = 0; break; } } if(flag == 1) puts("Yes"); else puts("No"); } return 0; }