There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r，c).

Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i，c_i) for each i (1≤i≤N). After that he fell asleep.

Mr. Aoki found the grid and tries to surprise Mr. Takahashi by writing integers into all remaining cells. The grid must meet the following conditions to really surprise Mr. Takahashi.

* Condition 1: Each cell contains a non-negative integer.
* Condition 2: For any 2×2 square formed by cells on the grid, the sum of the top left and bottom right integers must always equal to the sum of the top right and bottom left integers.



Determine whether it is possible to meet those conditions by properly writing integers into all remaining cells.

Constraints

* 2≤R，C≤10^5
* 1≤N≤10^5
* 1≤r_i≤R
* 1≤c_i≤C
* (r_i，c_i) ≠ (r_j，c_j) (i≠j)
* a_i is an integer.
* 0≤a_i≤10^9

Input

The input is given from Standard Input in the following format:


R C
N
r_1 c_1 a_1
r_2 c_2 a_2
:
r_N c_N a_N


Output

Print `Yes` if it is possible to meet the conditions by properly writing integers into all remaining cells. Otherwise, print `No`.

Examples

Input

2 2
3
1 1 0
1 2 10
2 1 20


Output

Yes


Input

2 3
5
1 1 0
1 2 10
1 3 20
2 1 30
2 3 40


Output

No


Input

2 2
3
1 1 20
1 2 10
2 1 0


Output

No


Input

3 3
4
1 1 0
1 3 10
3 1 10
3 3 20


Output

Yes


Input

2 2
4
1 1 0
1 2 10
2 1 30
2 2 20


Output

No
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
#define maxn 100005
using namespace std;

struct node
{
	ll x,y,val;
}tr[maxn];
ll t,n,r,c;
ll fa[maxn],del[maxn],mn1[maxn],mn2[maxn];//del[i]指i到父节点的差值
const ll oo=2e16;

bool cmp(node a,node b)
{
	if(a.y!=b.y)
	return a.y<b.y;
	else return a.x<b.x;
}//以y轴为第一关键字从小到大排序

ll find(ll a)
{
	if(fa[a]==a)
	return a;
	ll fax=find(fa[a]);
	del[a]+=del[fa[a]];//合并差值
	return fa[a]=fax;
}//找父亲

ll unionn(ll a,ll b,ll v)
{
	ll fax=find(a),fay=find(b);
	if(fax!=fay)
	{
		del[fax]=v+del[b]-del[a];//推导的性质
		fa[fax]=fay;//合并并查集
		return 1;
	}//不在同一个集合内
	else
	{
		if(del[a]!=del[b]+v)return 0;
		else return 1;
	}//在同一个集合内
}//并查集合并

int main()
{
	for(int i=1;i<=100000;++i)
	mn1[i]=mn2[i]=oo;
	ll flag=1;
	scanf("%lld%lld%lld",&r,&c,&n);
	for(ll i=1;i<=r;++i)
	{
		fa[i]=i;
		del[i]=0;
	}//初始化并查集
	for(ll i=1;i<=n;++i)
	{
		ll x,y,z;
		scanf("%lld%lld%lld",&x,&y,&z);
		tr[i].x=x;
		tr[i].y=y;
		tr[i].val=z;
		if(z<0)flag=0;
	}
	if(!flag)
	{
		printf("No\n");
		return 0;
	}
	if(r==1)
	{
		printf("Yes\n");
		return 0;
	}//特判行为1
	sort(tr+1,tr+1+n,cmp);//初始化排序
	for(ll i=1;i<n;++i)
	{
		if(tr[i].y==tr[i+1].y)
		{
			if(!unionn(tr[i].x,tr[i+1].x,tr[i+1].val-tr[i].val))//顺便结合两行
			flag=0;//与所得结论矛盾
		}
	}//判断是否矛盾
	if(!flag)
	{
		printf("No\n");
		return 0;
	}
	for(ll i=1;i<=n;++i)
	{
		ll fax=find(tr[i].x);
		mn1[fax]=min(mn1[fax],tr[i].val+del[tr[i].x]);
	}//求父节点行上一点的最小值
	for(ll i=1;i<=r;++i)
	{
		ll fax=find(i);
		mn2[fax]=min(mn2[fax],-del[i]);
	}//求某一行的父节点可能的最小值
	for(ll i=1;i<=r;++i)
	{
		if(fa[i]==i&&mn1[i]+mn2[i]<0)
		{
			flag=0;
			break;
		}
	}
	if(!flag)
	printf("No\n");
	else printf("Yes\n");
	return 0;
}