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

using namespace std;

int main(){

    int N;

    for(cin>>N;N;--N){

        int t,x,y;

        cin>>t>>x>>y;

        if(t<x+y||(t-x-y)&1)return cout<<"No",0;

    }

    return cout<<"Yes",0;

}

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



int main()

{

    int n,t,x,y,i;

    scanf("%d",&n);

    for(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");

    return 0;

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

#include<iostream>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<string>

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);

		if(a<b+c){printf("No\n");return 0;}

		if(a%2==1 and (b+c)%2==0){printf("No\n");return 0;}

		if(a%2==0 and (b+c)%2==1){printf("No\n");return 0;}

	}

	printf("Yes\n");

	return 0;

}


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



int main()

{

    int n,t,x,y,i;

    scanf("%d",&n);

    for(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");

    return 0;

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

#define ll long long

#define ull unsigned long long

#define reg register

#define in cin>>

#define out cout<<

using namespace std;

int main(){

	reg int n;

	in n;

	while(n--){

		reg int t,x,y;

		in t>>x>>y;

		if(t<x+y){

			out "No\n";

			return 0;

		}

		if(t%2!=(x+y)%2){

			out "No\n";

			return 0;

		}

	}

	out "Yes\n";

}

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



int main()

{

    int n,t,x,y,i;

    scanf("%d",&n);

    for(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");

    return 0;

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

#include <string>

#include <algorithm>

#include <map>

#include <math.h>

#include <iomanip>

#include <vector>

#include <queue>

#include <functional>

#include <random>

#include <time.h>

using namespace std;

typedef long long int ll;

typedef pair<ll, ll> P;

int main() {

	ll n, t[100010] = {}, x[100010] = {}, y[100010] = {};

	cin >> n;

	for (int i = 1; i <= n; i++) cin >> t[i] >> x[i] >> y[i];

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

		ll X, Y, T;

		X = abs(x[i - 1] - x[i]);

		Y = abs(y[i - 1] - y[i]);

		T = t[i] - t[i - 1];

		if (X + Y > T) {

			cout << "No" << endl;

			return 0;

		}

		T -= X;

		if (T < Y) {

			cout << "No" << endl;

			return 0;

		}

		else {

			if (Y % 2 != T % 2) {

				cout << "No" << endl;

				return 0;

			}

		}

	}

	cout << "Yes" << endl;

	return 0;

}


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

#include <list>

#include <stack>

#include <set>

#include <iomanip>

#include <random>

#include <time.h>

#include <vector>

#include <queue>

#include <functional>

#include <map>

#include <string>

#include <cstdlib>

#include <typeinfo>

#include <math.h>

#include <algorithm>

using namespace std;

typedef long long int ll;

typedef pair<ll, ll> P;



ll n, t, x, y;

int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);

	cin >> n;

	ll nt, nx, ny;

	nt = nx = ny = 0;

	bool f = 0;

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

		cin >> t >> x >> y;

		ll T = t - nt, X = abs(x - nx), Y = abs(y - ny);

		if (T < X + Y) {

			f = 1;

			break;

		}

		T -= X;

		if (T % 2 != Y % 2) {

			f = 1;

			break;

		}

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

	}

	cout << (f ? "No" : "Yes") << endl;

	return 0;

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

#include <cstdio>

using namespace std;



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

int dis,tim;

bool f;



int abs(int a,int b) {

	return a>b?a-b:b-a;

}



int main() {

//	freopen("c.in","r",stdin);

//	freopen("c.out","w",stdout);

	scanf("%d",&n);

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

	x[0]=0; y[0]=0; t[0]=0;

	int j=1; f=true;

	while (f && j<=n) {

		dis=abs(x[j],x[j-1])+abs(y[j],y[j-1]);

		tim=t[j]-t[j-1];

		if (dis>tim) f=false;

		if ((abs(dis,tim))%2!=0) f=false;

		j++;

	}

	if (f) printf("Yes\n"); else printf("No\n");

	fclose(stdin);

	fclose(stdout);

	return 0;

}


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

#include <cstdlib>

#include <cmath>

#define maxn 100005



bool solve(int tx,int ty,int x,int y,int t)

{

    int quick=abs(tx-x)+abs(ty-y);

    if(t<quick) return false;

    else if((t-quick)%2==0) return true;

    else return false;

}



int main()

{

//    freopen("Traveling.in","r",stdin);

//    freopen("Traveling.out","w",stdout);

    

    int n;

    scanf("%d",&n);

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

    bool key=true;

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

    {

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

        if(!solve(tx,ty,x,y,t-tt)) {key=false; break;}

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

    }

    

    if(key) printf("Yes");

    else printf("No");

    return 0;

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<algorithm>

using namespace std;

const int MAXN=1000;

struct node {

	int t,x,y;

};

int T(int x) {

	return x>-x?x:-x;

}

int  n;

node last,now;

int main()

{

	bool sign=0;

	scanf("%d",&n);

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

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

		if(T(now.t-last.t)%2!=(T(now.x-last.x)+T(now.y-last.y))%2||T(now.x-last.x)+T(now.y-last.y)>T(now.t-last.t))

			sign=1;

		last=now;

	}

	if(sign) printf("No");

	else printf("Yes");

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<algorithm>

using namespace std;

int n,nx,ny,tim;

struct P{

	int t,x,y;

}a[100005];

bool cmp(P S1,P S2){

	return S1.t<S2.t;

}

int abs(int x){

	return -x>x?-x:x;

}

int main(){

	scanf("%d",&n);

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

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

	sort(a+1,a+1+n,cmp);

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

		int jl=abs(a[i].x-nx)+abs(a[i].y-ny);

		tim+=jl;

		if(tim>a[i].t){

			printf("No\n");

			return 0;

		}

		else{

			if((a[i].t-tim)%2){

				printf("No\n");

				return 0;

			}

			else{

				tim=a[i].t;

				nx=a[i].x;

				ny=a[i].y;

			}

		}

	}

	printf("Yes\n");

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<cstring>

#include<algorithm>

#include<vector>

#include<queue>

#define MAXN 100000

using namespace std;



int n;

struct node

{

    int time,x,y;

}a[MAXN+5];



int main()

{

    scanf("%d",&n);

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

        scanf("%d%d%d",&a[i].time,&a[i].x,&a[i].y);

    int nx=0,ny=0,nt=0;

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

    {

        int t=abs(a[i].x-nx)+abs(a[i].y-ny);

        if(nt+t>a[i].time)

        {

            printf("No\n");

            return 0;

        }

        else if(nt+t<a[i].time)

        {

            int st=a[i].time-nt-t;

            if(st%2)

            {

                printf("No\n");

                return 0;

            }

        }

        nx=a[i].x,ny=a[i].y,nt=a[i].time;

    }

    printf("Yes\n");

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<cstring>

#include<cmath>

#include<algorithm>

#define MAXN 100000

using namespace std;

struct node

{

	int x,y,t;

}poi[MAXN+5];

bool cmp(node a,node b)

{

	if(a.t==b.t)

	{

		if(a.x==b.x)

			return a.y<b.y;

		return a.x<b.x;

	}

	return a.t<b.t;

}

int main()

{

	int n;

	scanf("%d",&n);

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

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

	sort(poi+1,poi+1+n,cmp);

	int posx=0,posy=0,post=0;

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

	{

		int t=poi[i].t,x=poi[i].x,y=poi[i].y;

		int delt=t-post;

		int mint=abs(x-posx)+abs(y-posy);

		if(delt%2==mint%2&&delt>=mint)

			posx=x,posy=y,post=t;

		else

		{

			printf("No\n");

			return 0;

		}

	}

	printf("Yes\n");

	return 0;

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

int main()

{

	int n;

	scanf("%d",&n);

	long long x=0LL,y=0LL,z=0LL,a,b,t;

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

	{

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

		long long len=a-x+b-y,tim=t-z;

		if(tim<len||(tim-len)%2)

		{

			printf("No\n");

			return 0;

		}

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

	}

	printf("Yes\n");

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<algorithm>

using namespace std;



int main(){

	int n;

	scanf("%d",&n);

	int nowt=0,nowx=0,nowy=0;

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

		int t,a,b;

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

		int pst=t-nowt;

		int psx=a-nowx,psy=b-nowy;

		int dis=abs(psx)+abs(psy);

		//printf("%d %d %d %d\n",t,a,b,dis);

		if(((dis&1)==(pst&1))&&(dis<=pst));

		else{

			printf("No");

			return 0;

		}

		nowt=t;

		nowx=a,nowy=b;

	}

	printf("Yes");

	return 0;

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

#include<algorithm>

using namespace std;



int main()

{

    int n,t=0,x=0,y=0,f=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))

            f=1;

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

    }

    if(!f)cout<<"Yes";

    else cout<<"No";

    return 0;

}


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

#include<algorithm>

using namespace std;



int main(){

	int n;

	scanf("%d",&n);

	int nowt=0,nowx=0,nowy=0;

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

		int t,a,b;

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

		int pst=t-nowt;

		int psx=a-nowx,psy=b-nowy;

		int dis=abs(psx)+abs(psy);

		//printf("%d %d %d %d\n",t,a,b,dis);

		if(((dis&1)==(pst&1))&&(dis<=pst));

		else{

			printf("No");

			return 0;

		}

		nowt=t;

		nowx=a,nowy=b;

	}

	printf("Yes");

	return 0;

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

#include <cmath>

using namespace std;

int N;

const int maxn = 100001;

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



int main(){

    int min_time,time;

    bool flag = true;

    cin>>N;

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

    {

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

    }

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

    {

        time = abs(t[i]-t[i-1]);

        min_time = abs(x[i]+y[i]-x[i-1]-y[i-1]);

        if(time<min_time)

        {

            flag = false;

            break;

        }

        else if(time>min_time)

        {

            if(min_time%2!=time%2)

            {

                flag = false;

                break;

            }

        }

    }

    if(flag)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

    return 0;

}


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

#include<algorithm>

using namespace std;



int main(){

	int n;

	scanf("%d",&n);

	int nowt=0,nowx=0,nowy=0;

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

		int t,a,b;

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

		int pst=t-nowt;

		int psx=a-nowx,psy=b-nowy;

		int dis=abs(psx)+abs(psy);

		//printf("%d %d %d %d\n",t,a,b,dis);

		if(((dis&1)==(pst&1))&&(dis<=pst));

		else{

			printf("No");

			return 0;

		}

		nowt=t;

		nowx=a,nowy=b;

	}

	printf("Yes");

	return 0;

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

using namespace std;



int n, t, x, y;



int main() {

	scanf("%d", &n);

	while (n--) {

		int tt, tx, ty;

		scanf("%d %d %d", &tt, &tx, &ty);

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

            puts("No");

            return 0;

        }

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

	}

	puts("Yes");

    return 0;

}

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

#include<algorithm>

using namespace std;



int main(){

	int n;

	scanf("%d",&n);

	int nowt=0,nowx=0,nowy=0;

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

		int t,a,b;

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

		int pst=t-nowt;

		int psx=a-nowx,psy=b-nowy;

		int dis=abs(psx)+abs(psy);

		//printf("%d %d %d %d\n",t,a,b,dis);

		if(((dis&1)==(pst&1))&&(dis<=pst));

		else{

			printf("No");

			return 0;

		}

		nowt=t;

		nowx=a,nowy=b;

	}

	printf("Yes");

	return 0;

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



using namespace std;



int main()

{

	int N;//特定时间个数 

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

	int tt,tx,ty;

	cin>>N;

	

	int i;

	for(i=0;i<N;i++)

	{

		//依次输入特点坐标并判断该坐标是否能在指定时间到达 

		cin>>tt>>tx>>ty;

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

			//两点需要的步数与实际走的步数奇偶性不同或者实际走的步数比需要走的步数多(超时) 

			flag=1;

		t=tt,x=tx,y=ty;//进行下一个点的判断 

	}

	

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

	else cout<<"No";

	

	return 0;

}

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

#include<algorithm>

using namespace std;



int main(){

	int n;

	scanf("%d",&n);

	int nowt=0,nowx=0,nowy=0;

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

		int t,a,b;

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

		int pst=t-nowt;

		int psx=a-nowx,psy=b-nowy;

		int dis=abs(psx)+abs(psy);

		//printf("%d %d %d %d\n",t,a,b,dis);

		if(((dis&1)==(pst&1))&&(dis<=pst));

		else{

			printf("No");

			return 0;

		}

		nowt=t;

		nowx=a,nowy=b;

	}

	printf("Yes");

	return 0;

}
// Slower C++ solution:
/*Lucky_Glass*/

#include<cstdio>

#include<iostream>

#include<cmath>

#include<queue>

using namespace std;

int main()

{

	int n,dx=0,dy=0,dt=0;

	scanf("%d",&n);

	bool T=true;

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

	{

		int t,x,y;

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

		if(abs(x-dx)+abs(y-dy)+dt<=t)

			if((t-abs(x-dx)+abs(y-dy)-dt)%2)

				T=false;

			else

				dx=x,dy=y,dt=t;

		else

			T=false;

	}

	if(T) puts("Yes");

	else puts("No");

	return 0;

}

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

#include<cstring>

#define INF 1e9+7

int main()

{

    int m;

    int a[100004][3];

    while(scanf("%d",&m)!=EOF)

    {

    	a[0][0]=a[0][1]=a[0][2]=0;

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

    	{

    		int x,y,z;

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

    		a[i][0]=x;a[i][1]=y;a[i][2]=z;

		}

		int ans=0;

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

		{

			int ant=a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2];

			int ant1=a[i][0]-a[i-1][0];

			if(ant1==ant)

			ans++;

			else if(ant1>ant)

			{

				ant1=ant1-ant;

				if(ant1%2==0)

			    ans++;

			}	

		}

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

		if(ans==m)

		printf("Yes\n");

		else

		printf("No\n");

	}

return 0;

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

#include<algorithm>

using namespace std;



int main()

{

    int n,t=0,x=0,y=0,f=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))

            f=1;

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

    }

    if(!f)cout<<"Yes";

    else cout<<"No";

    return 0;

}


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

#include<cstring>

#define INF 1e9+7

int main()

{

    int m;

    int a[100004][3];

    while(scanf("%d",&m)!=EOF)

    {

    	a[0][0]=a[0][1]=a[0][2]=0;

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

    	{

    		int x,y,z;

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

    		a[i][0]=x;a[i][1]=y;a[i][2]=z;

		}

		int ans=0;

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

		{

			int ant=a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2];

			int ant1=a[i][0]-a[i-1][0];

			if(ant1==ant)

			ans++;

			else if(ant1>ant)

			{

				ant1=ant1-ant;

				if(ant1%2==0)

			    ans++;

			}	

		}

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

		if(ans==m)

		printf("Yes\n");

		else

		printf("No\n");

	}

return 0;

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

#include <cmath>

using namespace std;

int N;

const int maxn = 100001;

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



int main(){

    int min_time,time;

    bool flag = true;

    cin>>N;

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

    {

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

    }

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

    {

        time = abs(t[i]-t[i-1]);

        min_time = abs(x[i]+y[i]-x[i-1]-y[i-1]);

        if(time<min_time)

        {

            flag = false;

            break;

        }

        else if(time>min_time)

        {

            if(min_time%2!=time%2)

            {

                flag = false;

                break;

            }

        }

    }

    if(flag)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

    return 0;

}


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

#include<cstring>

#define INF 1e9+7

int main()

{

    int m;

    int a[100004][3];

    while(scanf("%d",&m)!=EOF)

    {

    	a[0][0]=a[0][1]=a[0][2]=0;

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

    	{

    		int x,y,z;

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

    		a[i][0]=x;a[i][1]=y;a[i][2]=z;

		}

		int ans=0;

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

		{

			int ant=a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2];

			int ant1=a[i][0]-a[i-1][0];

			if(ant1==ant)

			ans++;

			else if(ant1>ant)

			{

				ant1=ant1-ant;

				if(ant1%2==0)

			    ans++;

			}	

		}

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

		if(ans==m)

		printf("Yes\n");

		else

		printf("No\n");

	}

return 0;

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

using namespace std;



int n, t, x, y;



int main() {

	scanf("%d", &n);

	while (n--) {

		int tt, tx, ty;

		scanf("%d %d %d", &tt, &tx, &ty);

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

            puts("No");

            return 0;

        }

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

	}

	puts("Yes");

    return 0;

}

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

#include<cstring>

#define INF 1e9+7

int main()

{

    int m;

    int a[100004][3];

    while(scanf("%d",&m)!=EOF)

    {

    	a[0][0]=a[0][1]=a[0][2]=0;

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

    	{

    		int x,y,z;

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

    		a[i][0]=x;a[i][1]=y;a[i][2]=z;

		}

		int ans=0;

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

		{

			int ant=a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2];

			int ant1=a[i][0]-a[i-1][0];

			if(ant1==ant)

			ans++;

			else if(ant1>ant)

			{

				ant1=ant1-ant;

				if(ant1%2==0)

			    ans++;

			}	

		}

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

		if(ans==m)

		printf("Yes\n");

		else

		printf("No\n");

	}

return 0;

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



using namespace std;



int main()

{

	int N;//特定时间个数 

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

	int tt,tx,ty;

	cin>>N;

	

	int i;

	for(i=0;i<N;i++)

	{

		//依次输入特点坐标并判断该坐标是否能在指定时间到达 

		cin>>tt>>tx>>ty;

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

			//两点需要的步数与实际走的步数奇偶性不同或者实际走的步数比需要走的步数多(超时) 

			flag=1;

		t=tt,x=tx,y=ty;//进行下一个点的判断 

	}

	

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

	else cout<<"No";

	

	return 0;

}

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

#include<cstring>

#define INF 1e9+7

int main()

{

    int m;

    int a[100004][3];

    while(scanf("%d",&m)!=EOF)

    {

    	a[0][0]=a[0][1]=a[0][2]=0;

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

    	{

    		int x,y,z;

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

    		a[i][0]=x;a[i][1]=y;a[i][2]=z;

		}

		int ans=0;

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

		{

			int ant=a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2];

			int ant1=a[i][0]-a[i-1][0];

			if(ant1==ant)

			ans++;

			else if(ant1>ant)

			{

				ant1=ant1-ant;

				if(ant1%2==0)

			    ans++;

			}	

		}

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

		if(ans==m)

		printf("Yes\n");

		else

		printf("No\n");

	}

return 0;

}