stablegradients/pie-gem5-pairs huggingface dataset:
// 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.411661167679766x):
#define _CRT_SECURE_NO_WARNINGS





#include<iostream>

#include<cstdio>

#include<algorithm>

#include<cmath>

#include<string>

#include<climits>

#include<vector>

#include<cstring>

#include<queue>







using std::cout;

using std::endl;

using std::cin;

using std::sort;

using std::strcmp;

using std::vector;

using std::queue;



#define SIZE 200

#define MINE -1

int map[SIZE][SIZE];







int main(int argc, char** argv)

{



	if (argc == 2 && strcmp(argv[1], "-debug") == 0)

	{

		freopen("in.txt", "r", stdin);

		freopen("out.txt", "w", stdout);

	}



	int n;

	cin >> n;

	int t, x, y;

	int t1 = 0, x1 = 0, y1 = 0;//上一步的数据

	int dt;

	int step = 0;

	bool success = true;

	while (n--)

	{

		cin >> t >> x >> y;

		dt = t - t1;

		step = std::abs(x - x1) + std::abs(y - y1);



		if (step > dt || (dt - step) % 2 == 1)

		{

			success = false;

			break;

		}



		t1 = t;

		x1 = x;

		y1 = y;

	}



	if (success)

		cout << "Yes";

	else

		cout << "No";





	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.4259440393605365x):
#include<iostream>

#include<stdio.h>

#include<string.h>

#include<cmath>

using namespace std;



struct _point

{

    int x;

    int y;

    int t;

}p[100010];



int main()

{

    int n;

    scanf("%d",&n);

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

    {

        scanf("%d%d%d",&p[i].t,&p[i].x,&p[i].y);

    }

    int ret=1;

    p[0].x=0;

    p[0].y=0;

    p[0].t=0;

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

    {

        int len=abs(p[i].x-p[i-1].x)+abs(p[i].y-p[i-1].y);

        int now=p[i].t-p[i-1].t;

        int x=now-len;

        if(x<0||x%2!=0)

        {

            ret=0;

            break;

        }

    }



    if(ret)

    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.256049240913912x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.29771459830444x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.225389142787529x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.207516556977668x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.224221767474243x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.268675192672883x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.224827357952066x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.272834693929221x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.4536598218921295x):
#include<stdio.h>

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    return 0;

}
// Slower C++ solution:
#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;

}

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

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    return 0;

}
// Slower C++ solution:
#define _CRT_SECURE_NO_WARNINGS





#include<iostream>

#include<cstdio>

#include<algorithm>

#include<cmath>

#include<string>

#include<climits>

#include<vector>

#include<cstring>

#include<queue>







using std::cout;

using std::endl;

using std::cin;

using std::sort;

using std::strcmp;

using std::vector;

using std::queue;



#define SIZE 200

#define MINE -1

int map[SIZE][SIZE];







int main(int argc, char** argv)

{



	if (argc == 2 && strcmp(argv[1], "-debug") == 0)

	{

		freopen("in.txt", "r", stdin);

		freopen("out.txt", "w", stdout);

	}



	int n;

	cin >> n;

	int t, x, y;

	int t1 = 0, x1 = 0, y1 = 0;//上一步的数据

	int dt;

	int step = 0;

	bool success = true;

	while (n--)

	{

		cin >> t >> x >> y;

		dt = t - t1;

		step = std::abs(x - x1) + std::abs(y - y1);



		if (step > dt || (dt - step) % 2 == 1)

		{

			success = false;

			break;

		}



		t1 = t;

		x1 = x;

		y1 = y;

	}



	if (success)

		cout << "Yes";

	else

		cout << "No";





	return 0;

}




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

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    return 0;

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

#include<stdio.h>

#include<string.h>

#include<cmath>

using namespace std;



struct _point

{

    int x;

    int y;

    int t;

}p[100010];



int main()

{

    int n;

    scanf("%d",&n);

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

    {

        scanf("%d%d%d",&p[i].t,&p[i].x,&p[i].y);

    }

    int ret=1;

    p[0].x=0;

    p[0].y=0;

    p[0].t=0;

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

    {

        int len=abs(p[i].x-p[i-1].x)+abs(p[i].y-p[i-1].y);

        int now=p[i].t-p[i-1].t;

        int x=now-len;

        if(x<0||x%2!=0)

        {

            ret=0;

            break;

        }

    }



    if(ret)

    printf("Yes\n");

    else

    printf("No\n");

    return 0;

}


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

int s[100005][5];

int main()

{

    int n,first=0;

    scanf("%d",&n);

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

        for(int j = 1;j <= 3;j++)

        scanf("%d",&s[i][j]);

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

    {

        int a,b;

        a = (s[i][2]+s[i][3])-(s[i-1][2]+s[i-1][3]);

        if(a<0) a=-a;

        b = s[i][1]-s[i-1][1];

        if(a>b||(a-b)%2||a==0&&(b-4)%2)  {first = 1;break;}

    }

    if(first)  printf("No");

    else printf("Yes");

    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.430176508732028x):
#include<bits/stdc++.h> //Ithea Myse Valgulious

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  re0 x=0,f=1;rec c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

inline void read(rel &x){

  x=0;re0 f=1;rec c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  x=f?x:-x;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return pc(48);

  if (x<0) x=-x,pc('-');

  re0 bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  }

inline char fuhao(){

  rec c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

int x,y,lt,n=read();

int main(){

for (;n--;){

  int t=read(),nx=read(),ny=read();

  if (((t-lt)^(nx-x+ny-y))&1||t-lt<abs(nx-x+ny-y)) return puts("No"),0; 

  lt=t,x=nx,y=ny;

  }puts("Yes");

}
// 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.4072736727309099x):
#include <bits/stdc++.h>



using namespace std;



int lx,ly,lt;

int n;



int main()

{

	cin >> n;

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

	{

		int x,y,t;

		cin >> t >> x >> y;

		if(abs(x-lx)+abs(y-ly)>t-lt)

		{

			cout << "No" << endl;

			return 0;

		}

		if((abs(x-lx)+abs(y-ly))%2!=(t-lt)%2)

		{

			cout << "No" << endl;

			return 0;

		}

		lx=x; ly=y; lt=t;

	}

	cout << "Yes" << endl;

}
// 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.4271485259270866x):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <vector>

#include <math.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <string>

#include <sstream>

#include <iostream>

#include <time.h>

#include <queue>

#include <list>

#include <map>

#include <set>

#include <vector>

#include <stack>

#include <string.h>

#define sf scanf

#define pf printf

#define lf double

#define p123 printf("123\n");

#define pn printf("\n");

#define pk printf(" ");

#define p(n) printf("%d",n);

#define pln(n) printf("%d\n",n);

#define s(n) scanf("%d",&n);

#define ss(n) scanf("%s",n);

#define ps(n) printf("%s",n);

#define sld(n) scanf("%lld",&n);

#define pld(n) printf("%lld",n);

#define slf(n) scanf("%lf",&n);

#define plf(n) printf("%lf",n);

#define sc(n) scanf("%c",&n);

#define pc(n) printf("%c",n);

#define gc getchar();

#define ll long long

#define re(n,a) memset(n,a,sizeof(n));

#define len(a) strlen(a)

#define eps 1e-7

#define zero(x) (((x) > 0? (x):(-x)) < eps)

using namespace std;

//https://codeforces.com/contest/1238/problems

//https://codeforces.com/contest/1238/submit



struct A{

    ll x,y,t;

}a[1000005];

int main(){

    ll n;

    ll h;

    ll sum  = 0ll;

    ll maxi = -1ll;

    sld(n)

    ll x,y;

    ll t0 = 0ll,t;

    int flag = 0;

    ll x0 = 0ll,y0 = 0ll;

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

        sld(t) sld(x) sld(y)

        if(t -t0 >= abs(x-x0)+abs(y-y0)){

            if((t-t0)&1){

                if((abs(x-x0)+abs(y-y0))&1 ){

                    t0 = t;

                    x0 = x;

                    y0 = y;

                }else{

                    flag = 1;

                }

            }else{

                if((abs(x-x0)+abs(y-y0))&1 ){

                   flag = 1;

                }else{



                     t0 = t;

                    x0 = x;

                    y0 = y;

                }

            }



        }else{

            flag = 1;

        }

    }

    if(flag == 1){

        puts("No");

    }else{

        puts("Yes");

    }











    return 0;

}