function f(x){if(x!=P[x]){s=f(P[x]);Q[x]+=Q[P[x]];P[x]=x=s}return x}
c{
#x=f(l=-$1);Q[y=f(r=-$2)]=T=Q[l]+$3-Q[r];x-y?P[y]=x:t+=T
#x=f(l=-$1);t+=(Q[y=f(r=-$2)]=Q[l]+$3-Q[r])&&x==y;P[y]=x
P[y=f(r=-$2)]=x=f(l=-$1);t+=(Q[y]=Q[l]+$3-Q[r])&&x~y
}
!c++{while($1+i--)P[i]=i}
END{print t?"No":"Yes"}