stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <cstdio>

#include <iostream>

using namespace std;

const int mod = 1000000007;

const int N = 100005;

int abs(int x){

	if (x < 0) return -x;

	return x;

}

int main(){

	int n;

	cin>>n;

	int flag = 1; int t,x,y,tx,ty,a;

	t = tx = ty = 0;

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

		cin>>a>>x>>y;

		//printf("%d %d %d\n",a-t,abs(x - tx + y - ty),a - t - abs(x-tx + y - ty));

		if (a - t < abs(x-tx + y - ty)) flag = 0;

		else if (a - t > abs(x- tx + y- ty) && ((a - t - abs(x-tx + y - ty))%2 != 0)) flag = 0;

		tx = x,ty = y,t = a; 

	}

	if (flag) puts("Yes");

	else puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.266519257704343x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

int a[100001];

int b[100001],c[100001];

int main()

{

	int n;

	scanf("%d",&n);

	c[0]=b[0]=a[0]=0;

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

	{

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

	}

	int flag=1;

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

	{

		int s=a[i]-a[i-1];

		int x=(b[i]-b[i-1])+(c[i]-c[i-1]);

		if(s-x==0||(s-x)%2==0&&s-x>0)

		{

			continue;

		}

		else

		{

			flag=0;

			break;

		}

	}	

	if(flag)

	printf("Yes\n");

	else

	printf("No\n");

	return 0;

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

#include <algorithm>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <iomanip>

using namespace std;

int sx,sy,x,y,n,sm,m,flag = 1;



int main()

{

    cin>>n;

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

    {

        cin>>m>>x>>y;

        if(x == sx && y == sy)

        {

            if((m - sm) % 2)flag = 0;

        }

        else

        {

            int d = abs(x - sx) + abs(y - sy);

            if(!((m - sm) && (m - sm) % d == 0 && ((m - sm) / d) % 2))flag = 0;

        }

        sx = x,sy = y,sm = m;

    }

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

    else cout<<"No"<<endl;

}


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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

#include <cmath>



using namespace std;

int main(){

	int n, t = 0, x = 0, y = 0, flag = 0;

	cin >> n;

	for (int i = 0, tt, tx, ty; i<n; i++){

		cin >> tt >> tx >> ty;

		if ((abs(tx - x) + abs(ty - y)) % 2 != (tt - t) % 2 || abs(tx - x) + abs(ty - y)>(tt - t))

			flag = 1;

		t = tt, x = tx, y = ty;

	}

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

	else cout << "No" << endl;



	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

using namespace std;

int main()

{

    int n,dis,x,y;

    scanf("%d",&n);

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

    {

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

        if(dis<(x+y))

        {

            printf("No");

            return 0;

        }

        else

        {

            if((x+y)%2==0)

            {

                if(dis%2==0)

                    continue;

                else

                {

                    printf("No");

                    return 0;

                }

            }

            else

            {

                if(dis%2==0)

                {

                    printf("No");

                    return 0;

                }

                else

                    continue;

            }

        }



    }

    printf("Yes");

    return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

#include <cstring>

#include <iostream>

#include <algorithm>

#define MAXN 100005

using namespace std ;



int n,x,y,t;



struct DATA{

	int x,y,t;

	bool operator <(const DATA v)const{return t<v.t;}

} A[MAXN];



inline int red(){

	int Res; char ch; bool flg; Res=flg=0;

	while (ch=getchar(),ch<48||57<ch) flg^=!(ch^'-'); Res=(ch&15);

	while (ch=getchar(),47<ch&&ch<58) Res=(Res<<1)+(Res<<3)+(ch&15);

	if (flg) return -Res; return Res;

}



int abs_(int x){

	if (x<0) return -x; return x;

}



int get(int x,int y,int x_,int y_){

	return abs_(x-x_)+abs_(y-y_);

}



int main(){

	n=red();

	for (int i=1;i<=n;i++) A[i].t=red(),A[i].x=red(),A[i].y=red();

	sort(A+1,A+1+n);

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

		int len=get(x,y,A[i].x,A[i].y);

		if (!(len<=A[i].t-t&&(len&1)==((A[i].t-t)&1))){

			puts("No");

			return 0;

		}

	}

	puts("Yes");

	return 0 ;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

using namespace std;



int n, t, x, y, px, py, pt;



int main() {

	scanf("%d", &n);

	while (n--) {

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

		int md = abs(px - x) + abs(py - y);

		if (md > t - pt) {

			puts("No");

			return 0;

		}

		if (md % 2 != (t - pt) % 2) {

			puts("No");

			return 0;

		}

		px = x; py = y; pt = t;

	}

	puts("Yes");

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

#include <iostream>

using namespace std;

const int mod = 1000000007;

const int N = 100005;

int abs(int x){

	if (x < 0) return -x;

	return x;

}

int main(){

	int n;

	cin>>n;

	int flag = 1; int t,x,y,tx,ty,a;

	t = tx = ty = 0;

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

		cin>>a>>x>>y;

		//printf("%d %d %d\n",a-t,abs(x - tx + y - ty),a - t - abs(x-tx + y - ty));

		if (a - t < abs(x-tx + y - ty)) flag = 0;

		else if (a - t > abs(x- tx + y- ty) && ((a - t - abs(x-tx + y - ty))%2 != 0)) flag = 0;

		tx = x,ty = y,t = a; 

	}

	if (flag) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

using namespace std;

#define LL long long 

#define ULL unsigned long long 



const int N = 2e5+11;

const int M = 1e6+11;

const int mod = 1e9+7;

const int inf = 0x3f3f3f3f;

const LL inff = 0x3f3f3f3f3f3f3f3f;





/*-----------------------------------------*/





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

int main(){

  	int n;scanf("%d",&n);

  	for(int i=1;i<=n;i++){ scanf("%d%d%d",&t[i],&x[i],&y[i]); }

	int X,Y; X=Y=0; 

	int flag=1;

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

		int step=abs(x[i]-X)+abs(y[i]-Y); 

		int cha;

		//printf("%d\n",step);

		if(i==1) cha=t[i]-step;  

		else cha=(t[i]-t[i-1])-step; 

		

		if(cha<0) {

			flag=0;break;

		}

		if(cha%2==0){

			X=x[i]; Y=y[i];continue;

		}else {

			flag=0;

			break;

		}

	}

	

	if(flag) puts("Yes");

	else puts("No");

return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

	int n;

	while(~scanf("%d",&n))

	{

		int x = 0,y = 0,q = 1;

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

		{

			int t,a,b;

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

			int c = x - a,d = y - b;

			if(c < 0) c = 0-c;

			if(d < 0) d = 0-d;

			int num = c + d;

			if(t < num||(t-num)%2!=0)

			{

				q = 0;

			}

		}

		if(q == 1) printf("Yes\n");

		else printf("No\n");

	}

return 0;

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

#include <algorithm>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <iomanip>

using namespace std;

int sx,sy,x,y,n,sm,m,flag = 1;



int main()

{

    cin>>n;

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

    {

        cin>>m>>x>>y;

        if(x == sx && y == sy)

        {

            if((m - sm) % 2)flag = 0;

        }

        else

        {

            int d = abs(x - sx) + abs(y - sy);

            if(!((m - sm) && (m - sm) % d == 0 && ((m - sm) / d) % 2))flag = 0;

        }

        sx = x,sy = y,sm = m;

    }

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

    else cout<<"No"<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.250509658488233x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

#include <cmath>



using namespace std;

int main(){

	int n, t = 0, x = 0, y = 0, flag = 0;

	cin >> n;

	for (int i = 0, tt, tx, ty; i<n; i++){

		cin >> tt >> tx >> ty;

		if ((abs(tx - x) + abs(ty - y)) % 2 != (tt - t) % 2 || abs(tx - x) + abs(ty - y)>(tt - t))

			flag = 1;

		t = tt, x = tx, y = ty;

	}

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

	else cout << "No" << endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2921311029184785x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

using namespace std;

int main()

{

    int n,dis,x,y;

    scanf("%d",&n);

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

    {

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

        if(dis<(x+y))

        {

            printf("No");

            return 0;

        }

        else

        {

            if((x+y)%2==0)

            {

                if(dis%2==0)

                    continue;

                else

                {

                    printf("No");

                    return 0;

                }

            }

            else

            {

                if(dis%2==0)

                {

                    printf("No");

                    return 0;

                }

                else

                    continue;

            }

        }



    }

    printf("Yes");

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.219881874393352x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

#include <cstring>

#include <iostream>

#include <algorithm>

#define MAXN 100005

using namespace std ;



int n,x,y,t;



struct DATA{

	int x,y,t;

	bool operator <(const DATA v)const{return t<v.t;}

} A[MAXN];



inline int red(){

	int Res; char ch; bool flg; Res=flg=0;

	while (ch=getchar(),ch<48||57<ch) flg^=!(ch^'-'); Res=(ch&15);

	while (ch=getchar(),47<ch&&ch<58) Res=(Res<<1)+(Res<<3)+(ch&15);

	if (flg) return -Res; return Res;

}



int abs_(int x){

	if (x<0) return -x; return x;

}



int get(int x,int y,int x_,int y_){

	return abs_(x-x_)+abs_(y-y_);

}



int main(){

	n=red();

	for (int i=1;i<=n;i++) A[i].t=red(),A[i].x=red(),A[i].y=red();

	sort(A+1,A+1+n);

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

		int len=get(x,y,A[i].x,A[i].y);

		if (!(len<=A[i].t-t&&(len&1)==((A[i].t-t)&1))){

			puts("No");

			return 0;

		}

	}

	puts("Yes");

	return 0 ;

}

// Faster C++ solution for the same problem (measured speedup: 5.20202812529101x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

using namespace std;



int n, t, x, y, px, py, pt;



int main() {

	scanf("%d", &n);

	while (n--) {

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

		int md = abs(px - x) + abs(py - y);

		if (md > t - pt) {

			puts("No");

			return 0;

		}

		if (md % 2 != (t - pt) % 2) {

			puts("No");

			return 0;

		}

		px = x; py = y; pt = t;

	}

	puts("Yes");

}

// Faster C++ solution for the same problem (measured speedup: 5.2187157294284665x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

#include <iostream>

using namespace std;

const int mod = 1000000007;

const int N = 100005;

int abs(int x){

	if (x < 0) return -x;

	return x;

}

int main(){

	int n;

	cin>>n;

	int flag = 1; int t,x,y,tx,ty,a;

	t = tx = ty = 0;

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

		cin>>a>>x>>y;

		//printf("%d %d %d\n",a-t,abs(x - tx + y - ty),a - t - abs(x-tx + y - ty));

		if (a - t < abs(x-tx + y - ty)) flag = 0;

		else if (a - t > abs(x- tx + y- ty) && ((a - t - abs(x-tx + y - ty))%2 != 0)) flag = 0;

		tx = x,ty = y,t = a; 

	}

	if (flag) puts("Yes");

	else puts("No");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.263122303199027x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

using namespace std;

#define LL long long 

#define ULL unsigned long long 



const int N = 2e5+11;

const int M = 1e6+11;

const int mod = 1e9+7;

const int inf = 0x3f3f3f3f;

const LL inff = 0x3f3f3f3f3f3f3f3f;





/*-----------------------------------------*/





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

int main(){

  	int n;scanf("%d",&n);

  	for(int i=1;i<=n;i++){ scanf("%d%d%d",&t[i],&x[i],&y[i]); }

	int X,Y; X=Y=0; 

	int flag=1;

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

		int step=abs(x[i]-X)+abs(y[i]-Y); 

		int cha;

		//printf("%d\n",step);

		if(i==1) cha=t[i]-step;  

		else cha=(t[i]-t[i-1])-step; 

		

		if(cha<0) {

			flag=0;break;

		}

		if(cha%2==0){

			X=x[i]; Y=y[i];continue;

		}else {

			flag=0;

			break;

		}

	}

	

	if(flag) puts("Yes");

	else puts("No");

return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.219320681647739x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

#include<cstring>

#include<algorithm>

#include<iostream>

#include<cmath>

using namespace std;

int a[100005];

int main()

{

	int n;

	int t,x,y,k,m=0,x1=0,y1=0,t1=0;

	cin>>n;

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

	{

		cin>>t>>x>>y;

		k=abs(x-x1)+abs(y-y1);

		if(((t-t1)-k)%2==0&&(t-t1)-k>=0)

		a[i]=1;

		else

		a[i]=0;

		x1=x;

		y1=y;

		t1=t;

    }

    int i;

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

    {

    	if(a[i]==0)

    	{

    		printf("No\n");

    		break;

		}

	}

	if(i>n)

	printf("Yes\n");

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.267277420573288x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int jin=0;

		int ti[100050]={0};

		int xi[100050]={0};

		int yi[100050]={0};

		int i;

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

		{

			scanf("%d%d%d",&ti[i],&xi[i],&yi[i]);

			int sum=xi[i]+yi[i]-xi[i-1]-yi[i-1];

			if(jin!=0)continue;

			if(sum<0){

				sum=-sum;

			}

			if(ti[i]>=sum){

				int l1=(ti[i]-ti[i-1])%2;

				int l2=sum%2;

				if(l1!=l2){

					jin=5;

				}

			}else {

				jin=5;

			}

		}

		if(jin){

			printf("No\n");

		}else {

			printf("Yes\n");

		}

		

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 7.445804080618831x):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<algorithm>

using namespace std;

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int t,x,y;

		int flag=0;

		int x1=0,t1=0;

		int y1=0;

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

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

			if(i==0){

				if(t-x-y-t1>=0){

				

					if((t-x-y-t1)%2)

					{

					flag=1;

					}

				}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			else{

					int w=(x-x1),z=(y-y1);

					if(w<0)w=-w;

					if(z<0)z=-z;

					if(t-t1-w-z>=0)

					{

						if((t-t1-w-z)%2)

						{

							flag=1;

						}

					}

				else {

					flag=1;

				}

				x1=x;

				y1=y;

				t1=t;

			}

			

		}

		if(flag==0)printf("Yes\n");

		else 	printf("No\n");

	}

	return 0;

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

int main(){

	int n;

	while(~scanf("%d",&n))

	{

		int jin=0;

		int ti[100050]={0};

		int xi[100050]={0};

		int yi[100050]={0};

		int i;

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

		{

			scanf("%d%d%d",&ti[i],&xi[i],&yi[i]);

			int sum=xi[i]+yi[i]-xi[i-1]-yi[i-1];

			if(jin!=0)continue;

			if(sum<0){

				sum=-sum;

			}

			if(ti[i]>=sum){

				int l1=(ti[i]-ti[i-1])%2;

				int l2=sum%2;

				if(l1!=l2){

					jin=5;

				}

			}else {

				jin=5;

			}

		}

		if(jin){

			printf("No\n");

		}else {

			printf("Yes\n");

		}

		

	}

	return 0;

}

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

#include<cstdio>

#include<cmath>

using namespace std;

int main()

{

	int n,t,x,y,tt,xx,yy;

	while(~scanf("%d",&n))

	{

		t=0,x=0,y=0;

		int flag=0;

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

		{

			cin>>tt>>xx>>yy;

			if(flag)

				continue;

			int te=tt-t-(abs(yy-y)+abs(xx-x));

			if(te<0)

				flag=1; 

			else

			{

				if(te&1)

					flag=1;			

			} 

			t=tt,x=xx,y=yy;

		}

		if(flag)

			cout<<"No";

		else

			cout<<"Yes";

	}

	return 0;

}