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