#include<cstdio>
const int maxn = 100005;
int par[maxn],rot[maxn],flag,vis[maxn];
void Init()
{
for(int i = 0; i < maxn; i++)
{
par[i] = i;
rot[i] = 0;
vis[i] = 0;
}
}
int Find(int x)
{
if(x == par[x])
return x;
int t = Find(par[x]);
return par[x] = t;
}
void Union(int x, int y)
{
x = Find(x);
y = Find(y);
if(x == y){flag = 1;return;}
if(rot[x]>rot[y])
{
par[y] = x;
}
else
{
par[x] = y;
rot[y]++;
}
}
int main()
{
int n,m;
while(scanf("%d%d",&n,&m) != EOF)
{
if(n==-1 && m==-1)
break;
if(n == 0 && m == 0)
{
puts("Yes");
continue;
}
Init();
flag = 0;
vis[n]=vis[m] = 1;
Union(n,m);
while(scanf("%d%d",&n,&m))
{
if(n == 0 && m == 0)
break;
vis[n]=vis[m] = 1;
Union(n,m);
}
int cnt = 0;
for(int i = 1; i < maxn; i++)
if(vis[i] && par[i] == i)
cnt++;
if(cnt > 1)flag = 1;
if(!flag)
puts("Yes");
else
puts("No");
}
return 0;
}