stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;cin>>n;

    while(n--)

    {

        int t,x,y;

        cin>>t>>x>>y;

        if(t<abs(x)+abs(y)||(abs(x)+abs(y)-t)%2!=0) return puts("No"),0;

    }

	puts("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.270157282853133x):
#include<cstdio>

using namespace std;

int n,t,x,y;

int main()

{

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

  {

  	scanf("%d%d%d",&t,&x,&y);

  	if(x+y>t||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>//懒人专用头文件

#define inr int

#define rpt(n) for(register inr ttxyc=0;ttxyc<n;++ttxyc)//宏定义

using namespace std;

inline int read()//快读

{

	register int x=0,t=0;register char c=getchar();

	for(;c<'0'||c>'9';t|=c=='-',c=getchar());

	for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+(c^48),c=getchar());

	return t?-x:x;

}

int n,t,x,y,nowt,nowx,nowy,ft,f;

main()

{

	n=read();

	rpt(n)

	{

		t=read();x=read();y=read();

		ft=t-nowt;f=abs(x-nowx)+abs(y-nowy);

		if(ft<f||(ft-f)%2){puts("No");return 0;}

		nowt=t;nowx=x;nowy=y;

	}

	puts("Yes");

}/**/

// Faster C++ solution for the same problem (measured speedup: 5.208648083560262x):
#include<cstdio>

using namespace std;

int n,t,x,y;

int main()

{

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

  {

  	scanf("%d%d%d",&t,&x,&y);

  	if(x+y>t||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

}
// Slower C++ solution:
#include<iostream>

#include<iomanip>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<set>

using namespace std;

int t,x,y,n;

int bj=1;

int main() {

	cin>>n;

	while(n--){

		cin>>t>>x>>y;

		if(x+y>t)bj=0;

		if(((x+y)&1)!=(t&1))bj=0;

	}

	if(bj)puts("Yes");

	else puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.229634480708692x):
#include<cstdio>

using namespace std;

int n,t,x,y;

int main()

{

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

  {

  	scanf("%d%d%d",&t,&x,&y);

  	if(x+y>t||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,t,x,y;

int main(){

    scanf("%d",&n);

    for (int i=0;i<n;i++){

        scanf("%d%d%d",&t,&x,&y);

        if (x+y>t){

            printf ("No\n");

            return 0;

        }

        if ((x+y)%2==0&&t%2){

            printf("No\n");

            return 0;

        }

        if((x+y)%2&&t%2==0){

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.228295230034741x):
#include<cstdio>

using namespace std;

int n,t,x,y;

int main()

{

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

  {

  	scanf("%d%d%d",&t,&x,&y);

  	if(x+y>t||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	int a,b,n,tol,tim;

	cin>>n;

	for(int i=0;i<n;++i){

		cin>>tim>>a>>b;

		tol=a+b;

		if((tim-tol)%2==1||tim<tol){

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.298056152618275x):
#include<cstdio>

using namespace std;

int n,t,x,y;

int main()

{

  scanf("%d",&n);

  for(int i=1;i<=n;i++)

  {

  	scanf("%d%d%d",&t,&x,&y);

  	if(x+y>t||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstdio>

using namespace std;

int n,x,y,zjl,t,ca,cb,alltime,nowtime;

int main()

{

	cin>>n;

	for(int i=1;i<=n;i++)

	{

		cin>>t>>x>>y;

		nowtime=t-alltime;

		zjl=abs(x-ca)+abs(y-cb);

		if(zjl==nowtime||zjl<nowtime&&(nowtime-zjl)%2==0) {ca=x;cb=y;} else {cout<<"No\n";return 0;}

		alltime=t;

	}

	cout<<"Yes\n";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.29153389803028x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include <iostream>

#include <cmath>

using namespace std;



int x,y,t;

int n,a,b,c;



int main()

{

	cin>>n;

	for(int i=1;i<=n;i++) {

		cin>>c>>a>>b;

		int sum=abs(a-x)+abs(b-y),ti=c-t;

		if(sum>ti||(sum%2!=ti%2)) { cout<<"No"<<endl; return 0; }

		x=a,y=b,t=c;

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3054408401176705x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

    for(int i=1;i<=n;i++)

    {

        cin>>c>>a>>b;

        if(abs(x-a)+abs(y-b)>c-t)

        {

            cout<<"No";

            return 0;

        }

        if((abs(x-a)+abs(y-b))%2==0 &&(c-t)%2==1)

        {

            cout<<"No";

            return 0;

        }

        if((abs(x-a)+abs(y-b))%2==1 &&(c-t)%2==0)

        {

            cout<<"No";

            return 0;

        }

        x=a;y=b;t=c;

    }

    cout<<"Yes";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.292116564005812x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&c,&a,&b);

        if(abs(x-a)+abs(y-b)>c-t)

        {

            printf("No");

            return 0;

        }

        if((abs(x-a)+abs(y-b))%2==0 &&(c-t)%2==1)

        {

            printf("No");

            return 0;

        }

        if((abs(x-a)+abs(y-b))%2==1 &&(c-t)%2==0)

        {

            printf("No");

            return 0;

        }

        x=a;y=b;t=c;

    }

    printf("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.294810141911694x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;cin>>n;

    while(n--)

    {

        int t,x,y;

        cin>>t>>x>>y;

        if(t<abs(x)+abs(y)||(abs(x)+abs(y)-t)%2!=0) return puts("No"),0;

    }

	puts("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2774749263684555x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>//懒人专用头文件

#define inr int

#define rpt(n) for(register inr ttxyc=0;ttxyc<n;++ttxyc)//宏定义

using namespace std;

inline int read()//快读

{

	register int x=0,t=0;register char c=getchar();

	for(;c<'0'||c>'9';t|=c=='-',c=getchar());

	for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+(c^48),c=getchar());

	return t?-x:x;

}

int n,t,x,y,nowt,nowx,nowy,ft,f;

main()

{

	n=read();

	rpt(n)

	{

		t=read();x=read();y=read();

		ft=t-nowt;f=abs(x-nowx)+abs(y-nowy);

		if(ft<f||(ft-f)%2){puts("No");return 0;}

		nowt=t;nowx=x;nowy=y;

	}

	puts("Yes");

}/**/

// Faster C++ solution for the same problem (measured speedup: 5.215880321200735x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<iostream>

#include<iomanip>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<set>

using namespace std;

int t,x,y,n;

int bj=1;

int main() {

	cin>>n;

	while(n--){

		cin>>t>>x>>y;

		if(x+y>t)bj=0;

		if(((x+y)&1)!=(t&1))bj=0;

	}

	if(bj)puts("Yes");

	else puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.236895858081579x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,t,x,y;

int main(){

    scanf("%d",&n);

    for (int i=0;i<n;i++){

        scanf("%d%d%d",&t,&x,&y);

        if (x+y>t){

            printf ("No\n");

            return 0;

        }

        if ((x+y)%2==0&&t%2){

            printf("No\n");

            return 0;

        }

        if((x+y)%2&&t%2==0){

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2355547478504105x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	int a,b,n,tol,tim;

	cin>>n;

	for(int i=0;i<n;++i){

		cin>>tim>>a>>b;

		tol=a+b;

		if((tim-tol)%2==1||tim<tol){

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.305412533873757x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

	int n;bool flag=1;

	cin>>n;

	for(int i=1;i<=n;i++){

		int t,x,y;

		cin>>t>>x>>y;

		if(t<x+y) flag=0;

		if((t-x-y)%2) flag=0;

	}

	if(flag) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.306781397037486x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,a,b,c;

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&a,&b,&c);

		b=max(b,-b),c=max(c,-c);

		if((b+c)%2!=a%2)

		{

			cout<<"No\n";

			return 0;

		}

		if(b+c>a)

		{

			cout<<"No\n";

			return 0;

		}

	}

	cout<<"Yes\n";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.245069839322897x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main() {

	int n,x,y,t;

	cin>>n;

	for(int i=0; i<n; i++) {

		cin>>t>>x>>y;

		if(x+y>t||(t-x-y)%2) {

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.305158258185765x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	int a,b,c,d,e;

	scanf("%d",&a);

	for(b=1;b<=a;b++){

		scanf("%d%d%d",&c,&d,&e);

		if(c<d+e){

			printf("No");

			return 0;

		}

		if(c%2!=(d+e)%2){

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.233809094216649x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
// luogu-judger-enable-o2

#include<iostream>

const int N=100001;

using namespace std;

int n,x[N],y[N],t[N];

int main(){

    cin>>n;

    for(int i=1;i<=n;i++){

        cin>>t[i]>>x[i]>>y[i];

    }

    for(int i=1;i<=n;i++)

        if(x[i]+y[i]>t[i]||(t[i]-x[i]-y[i])%2!=0){

            cout<<"No";

            return 0;   

            }

    cout<<"Yes";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.294738065827655x):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d%d%d",&t,&x,&y);

		if(x+y>t) return printf("No\n"),0;

		if((x+y)%2==0&&t%2==1) return printf("No\n"),0;

		if((x+y)%2==1&&t%2==0) return printf("No\n"),0;

	}

	return printf("Yes\n"),0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstdio>

using namespace std;

int n,x,y,zjl,t,ca,cb,alltime,nowtime;

int main()

{

	cin>>n;

	for(int i=1;i<=n;i++)

	{

		cin>>t>>x>>y;

		nowtime=t-alltime;

		zjl=abs(x-ca)+abs(y-cb);

		if(zjl==nowtime||zjl<nowtime&&(nowtime-zjl)%2==0) {ca=x;cb=y;} else {cout<<"No\n";return 0;}

		alltime=t;

	}

	cout<<"Yes\n";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.29153389803028x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cmath>

using namespace std;



int x,y,t;

int n,a,b,c;



int main()

{

	cin>>n;

	for(int i=1;i<=n;i++) {

		cin>>c>>a>>b;

		int sum=abs(a-x)+abs(b-y),ti=c-t;

		if(sum>ti||(sum%2!=ti%2)) { cout<<"No"<<endl; return 0; }

		x=a,y=b,t=c;

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3054408401176705x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&c,&a,&b);

        if(abs(x-a)+abs(y-b)>c-t)

        {

            printf("No");

            return 0;

        }

        if((abs(x-a)+abs(y-b))%2==0 &&(c-t)%2==1)

        {

            printf("No");

            return 0;

        }

        if((abs(x-a)+abs(y-b))%2==1 &&(c-t)%2==0)

        {

            printf("No");

            return 0;

        }

        x=a;y=b;t=c;

    }

    printf("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.294810141911694x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;cin>>n;

    while(n--)

    {

        int t,x,y;

        cin>>t>>x>>y;

        if(t<abs(x)+abs(y)||(abs(x)+abs(y)-t)%2!=0) return puts("No"),0;

    }

	puts("Yes");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2774749263684555x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>//懒人专用头文件

#define inr int

#define rpt(n) for(register inr ttxyc=0;ttxyc<n;++ttxyc)//宏定义

using namespace std;

inline int read()//快读

{

	register int x=0,t=0;register char c=getchar();

	for(;c<'0'||c>'9';t|=c=='-',c=getchar());

	for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+(c^48),c=getchar());

	return t?-x:x;

}

int n,t,x,y,nowt,nowx,nowy,ft,f;

main()

{

	n=read();

	rpt(n)

	{

		t=read();x=read();y=read();

		ft=t-nowt;f=abs(x-nowx)+abs(y-nowy);

		if(ft<f||(ft-f)%2){puts("No");return 0;}

		nowt=t;nowx=x;nowy=y;

	}

	puts("Yes");

}/**/

// Faster C++ solution for the same problem (measured speedup: 5.215880321200735x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<iomanip>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<set>

using namespace std;

int t,x,y,n;

int bj=1;

int main() {

	cin>>n;

	while(n--){

		cin>>t>>x>>y;

		if(x+y>t)bj=0;

		if(((x+y)&1)!=(t&1))bj=0;

	}

	if(bj)puts("Yes");

	else puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.236895858081579x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,t,x,y;

int main(){

    scanf("%d",&n);

    for (int i=0;i<n;i++){

        scanf("%d%d%d",&t,&x,&y);

        if (x+y>t){

            printf ("No\n");

            return 0;

        }

        if ((x+y)%2==0&&t%2){

            printf("No\n");

            return 0;

        }

        if((x+y)%2&&t%2==0){

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2355547478504105x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	int a,b,n,tol,tim;

	cin>>n;

	for(int i=0;i<n;++i){

		cin>>tim>>a>>b;

		tol=a+b;

		if((tim-tol)%2==1||tim<tol){

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.305412533873757x):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

    {

        scanf("%d%d%d",&t,&x,&y);

        if(x+y>t)//不用绕，使出吃奶的劲儿都到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//如果最优路径与时间的积偶不一，一定到不了

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==1&&t%2==0)//同理

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//因为如果No就都return 0了，所以剩下一定是Yes。

    return 0;

}