/*
并查集问题,判断是否连通 并且没有环 若果2个点的根节点相同的话说明会成环,想象一下就知道了
*/
#include<cstdio>
#include<cstring>#define M 100010
int p[M],vis[M],deg[M];
int init()
{
for(int i = 0; i <= M; i++)
p[i] = i;
memset(vis,0,sizeof(vis));
memset(deg,0,sizeof(deg));
}
int find(int x)
{
return x==p[x]?x:p[x]=find(p[x]);
}
int Union(int x,int y)
{
vis[x]=vis[y]=1;
int px=find(x);
int py=find(y);
if(px!=py)
{
p[py] = px;
deg[y]++;
return 1;
}
else return 0;
}
int main()
{
int a,b,kc=1,sg=0;
while(scanf("%d%d",&a,&b)==2)
{
if(!a&&!b)
{
puts("Yes");
continue;
}
if(a<0&&b<0) break;
int l=1<<30,r=-1;
if(l>a) l = a;
if(l>b) l = b;
if(r<a) r = a;
if(r<b) r = b;
init();
int xu= Union(a,b);
if(xu==0) sg=1;
while(1)
{
scanf("%d%d",&a,&b);
if(!a&&!b) break;
int x=Union(a,b);
if(x==0) sg=1;
if(l>a) l = a;
if(l>b) l = b;
if(r<a) r = a;
if(r<b) r = b;
}
if(sg)
{
puts("No");
continue;
}
int count=0;
for(int i = l; i <= r; i++)
if(p[i]==i&&vis[i])
count++;
if(count!=1)
printf("No\n");
else printf("Yes\n");
sg=0;
}
}