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

using namespace std;



#define DB	double

#define lf	else if

#define	I64	long long

#define Rd()	(rand() << 15 | rand())

#define For(i,a,b)	for(int i=a;i<=b;i++)

#define Rep(i,a,b)	for(int i=a;i>=b;i--)

	

#define fi	first

#define se	second

#define MK	make_pair

#define PA	pair<int, int>



#define CH	(ch=getchar())

int		IN()	{

		int x= 0, f= 0, ch;

		for (; CH < '0' || ch > '9';)	f= (ch == '-');

		for (; ch >= '0' && ch <= '9'; CH)	(x*= 10)+= ch - '0';

		return	f ? -x : x;

}



#define n	100005



int		N, X[n], Y[n], t[n];



int		main()	{

		N= IN();

		For(i, 1, N)	t[i]= IN(), X[i]= IN(), Y[i]= IN();

		

		For(i, 1, N)	{

			if	(abs(X[i] - X[i-1]) + abs(Y[i] - Y[i-1]) > t[i] - t[i-1] || (t[i] - t[i-1] - abs(X[i] - X[i-1]) + abs(Y[i] - Y[i-1])) % 2)	return	puts("No"), 0;

		}

		

		puts("Yes");

}


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

#include<algorithm>

using namespace std;

int main()

{

	int n;

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

		int T1=0,x1=0,y1=0,flag=true,T2,x2,y2;

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

			scanf("%d %d %d",&T2,&x2,&y2);

			int c = max(x2,x1) - min(x2,x1);

			int d = max(y2,y1) - min(y2,y1);

			c = c + d;

			int e = T2-T1-c;

			if(e%2!=0||e<0){

				flag = false;

			}

			x1 = x2;	y1 = y2;	T1 = T2;

		}

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

		else	printf("No\n");

	}

	return 0;

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

#include <iostream>

#include <set>

#include <algorithm>

#include <string>

#include <cstring>

#include <map>

#include <cmath>

#include <queue>

using namespace std;

const int maxn = 1e5 + 100;

struct p{

    int x,y,t;

}a[maxn];

bool cmp(p a,p b){

     return a.t < b.t;

}

int main(){

    int N;

    scanf("%d",&N);

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

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

    }

    a[N].t = 0;

    a[N].x = 0;

    a[N].y = 0;

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

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

        if (a[i].t == a[i - 1].t)

        {

             printf("No\n");

             return 0;

        }

        int dis = abs(a[i].x - a[i - 1].x)  + abs(a[i].y - a[i - 1].y);

        int t = abs(a[i].t - a[i - 1].t);

        if (dis > t)

        {

             printf("No\n");

             return 0;

        }else 

        {

            if (dis < t)

            {

                if ((t - dis) & 1)

                {

                    printf("No\n");

                    return 0;

                }

            }

        }

    }

    printf("Yes\n");

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

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

		int T1=0,x1=0,y1=0,flag=true,T2,x2,y2;

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

			scanf("%d %d %d",&T2,&x2,&y2);

			int c = max(x2,x1) - min(x2,x1);

			int d = max(y2,y1) - min(y2,y1);

			c = c + d;

			int e = T2-T1-c;

			if(e%2!=0||e<0){

				flag = false;

			}

			x1 = x2;	y1 = y2;	T1 = T2;

		}

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

		else	printf("No\n");

	}

	return 0;

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

Date: Fri Mar  9 13:03:20 CST 2018

Author: ycl

*********************************/

#include <iostream>

#include <cstdio>

#include <string>

#include <cstring>

#include <cmath>

#include <cctype>

#include <cstdlib>

#include <algorithm>

#include <queue>

#include <stack>

#include <map>

#include <vector>

#include <list>

#include <set>

#include <sstream>

using namespace std;

#define CL(a) memset(a,0,sizeof(a))

#define Cl(a,b) memset(a,b,sizeof(a))

#define MP(a,b) make_pair(a,b)

#define INF 0x7fffffff

#define LL long long

const int MOD = 1e9 + 7;

const int maxn = 1e6 + 100;

struct Node

{

	int x,y,t;

	friend bool operator <(Node a,Node b)

	{

		return a.t<b.t;

	}

}node[maxn];

bool check(int v,int u)

{

	int d=abs(node[v].x-node[u].x) + abs(node[u].y-node[v].y) ;

	int t = node[u].t-node[v].t ;

	if (d<=t && (t-d)%2==0)

		return true;

	else

		return false;

}

int main()

{

	int n;

	scanf("%d",&n);

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

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

	}

	sort(node,node+n);

	bool f=1;

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

		if (!check(i,i+1)){

			f=0;

			break;

		}

	}

	if (f)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

	int n;

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

		int T1=0,x1=0,y1=0,flag=true,T2,x2,y2;

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

			scanf("%d %d %d",&T2,&x2,&y2);

			int c = max(x2,x1) - min(x2,x1);

			int d = max(y2,y1) - min(y2,y1);

			c = c + d;

			int e = T2-T1-c;

			if(e%2!=0||e<0){

				flag = false;

			}

			x1 = x2;	y1 = y2;	T1 = T2;

		}

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

		else	printf("No\n");

	}

	return 0;

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

using namespace std;

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

int main()

{

	int n;

	cin>>n;

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

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

	int flag=0;

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

	{

		int k=abs(x[i]-x[i-1])+abs(y[i]-y[i-1])-abs(t[i]-t[i-1]);

		if(abs(k)%2==1||k>0)

		{

			flag=1;

			break;

		}

	}

	if(flag)

		puts("No");

	else

		puts("Yes");

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

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

		int T1=0,x1=0,y1=0,flag=true,T2,x2,y2;

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

			scanf("%d %d %d",&T2,&x2,&y2);

			int c = max(x2,x1) - min(x2,x1);

			int d = max(y2,y1) - min(y2,y1);

			c = c + d;

			int e = T2-T1-c;

			if(e%2!=0||e<0){

				flag = false;

			}

			x1 = x2;	y1 = y2;	T1 = T2;

		}

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

		else	printf("No\n");

	}

	return 0;

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

#include<cstring>

#include<iostream>

#include<cmath>

#include<algorithm>

using namespace std;



int main()

{

	int n;

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

		int x1=0,y1=0,t1=0,x2,y2,t2;

		int flag=1;

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

			scanf("%d%d%d",&t2,&x2,&y2);

			int s=abs(x2-x1)+abs(y2-y1);

			if(abs(s)>abs(t2-t1)) flag=0;

			s=abs(abs(s)-abs(t1-t2));

			if(s%2!=0){

				flag=0;

			}

			t1=t2;

			x1=x2;

			y1=y2;

			

		}

		if(flag==0){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

		

	}

	

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n;

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

		int T1=0,x1=0,y1=0,flag=true,T2,x2,y2;

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

			scanf("%d %d %d",&T2,&x2,&y2);

			int c = max(x2,x1) - min(x2,x1);

			int d = max(y2,y1) - min(y2,y1);

			c = c + d;

			int e = T2-T1-c;

			if(e%2!=0||e<0){

				flag = false;

			}

			x1 = x2;	y1 = y2;	T1 = T2;

		}

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

		else	printf("No\n");

	}

	return 0;

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

using namespace std;

int main(){

	int n,x[100020],y[100020],t[100020],ans=0;

	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])%2!=t[i]%2){

			cout<<"No";

			return 0;

		}

		if(x[i]+y[i]<=t[i]){

			ans=ans+1;

		}

	}

	if(ans==n){

		cout<<"Yes";

	}

	else cout<<"No";

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

using namespace std;



#define DB	double

#define lf	else if

#define	I64	long long

#define Rd()	(rand() << 15 | rand())

#define For(i,a,b)	for(int i=a;i<=b;i++)

#define Rep(i,a,b)	for(int i=a;i>=b;i--)

	

#define fi	first

#define se	second

#define MK	make_pair

#define PA	pair<int, int>



#define CH	(ch=getchar())

int		IN()	{

		int x= 0, f= 0, ch;

		for (; CH < '0' || ch > '9';)	f= (ch == '-');

		for (; ch >= '0' && ch <= '9'; CH)	(x*= 10)+= ch - '0';

		return	f ? -x : x;

}



#define n	100005



int		N, X[n], Y[n], t[n];



int		main()	{

		N= IN();

		For(i, 1, N)	t[i]= IN(), X[i]= IN(), Y[i]= IN();

		

		For(i, 1, N)	{

			if	(abs(X[i] - X[i-1]) + abs(Y[i] - Y[i-1]) > t[i] - t[i-1] || (t[i] - t[i-1] - abs(X[i] - X[i-1]) + abs(Y[i] - Y[i-1])) % 2)	return	puts("No"), 0;

		}

		

		puts("Yes");

}


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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

#include <iostream>

#include <set>

#include <algorithm>

#include <string>

#include <cstring>

#include <map>

#include <cmath>

#include <queue>

using namespace std;

const int maxn = 1e5 + 100;

struct p{

    int x,y,t;

}a[maxn];

bool cmp(p a,p b){

     return a.t < b.t;

}

int main(){

    int N;

    scanf("%d",&N);

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

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

    }

    a[N].t = 0;

    a[N].x = 0;

    a[N].y = 0;

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

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

        if (a[i].t == a[i - 1].t)

        {

             printf("No\n");

             return 0;

        }

        int dis = abs(a[i].x - a[i - 1].x)  + abs(a[i].y - a[i - 1].y);

        int t = abs(a[i].t - a[i - 1].t);

        if (dis > t)

        {

             printf("No\n");

             return 0;

        }else 

        {

            if (dis < t)

            {

                if ((t - dis) & 1)

                {

                    printf("No\n");

                    return 0;

                }

            }

        }

    }

    printf("Yes\n");

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

Date: Fri Mar  9 13:03:20 CST 2018

Author: ycl

*********************************/

#include <iostream>

#include <cstdio>

#include <string>

#include <cstring>

#include <cmath>

#include <cctype>

#include <cstdlib>

#include <algorithm>

#include <queue>

#include <stack>

#include <map>

#include <vector>

#include <list>

#include <set>

#include <sstream>

using namespace std;

#define CL(a) memset(a,0,sizeof(a))

#define Cl(a,b) memset(a,b,sizeof(a))

#define MP(a,b) make_pair(a,b)

#define INF 0x7fffffff

#define LL long long

const int MOD = 1e9 + 7;

const int maxn = 1e6 + 100;

struct Node

{

	int x,y,t;

	friend bool operator <(Node a,Node b)

	{

		return a.t<b.t;

	}

}node[maxn];

bool check(int v,int u)

{

	int d=abs(node[v].x-node[u].x) + abs(node[u].y-node[v].y) ;

	int t = node[u].t-node[v].t ;

	if (d<=t && (t-d)%2==0)

		return true;

	else

		return false;

}

int main()

{

	int n;

	scanf("%d",&n);

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

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

	}

	sort(node,node+n);

	bool f=1;

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

		if (!check(i,i+1)){

			f=0;

			break;

		}

	}

	if (f)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

using namespace std;

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

int main()

{

	int n;

	cin>>n;

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

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

	int flag=0;

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

	{

		int k=abs(x[i]-x[i-1])+abs(y[i]-y[i-1])-abs(t[i]-t[i-1]);

		if(abs(k)%2==1||k>0)

		{

			flag=1;

			break;

		}

	}

	if(flag)

		puts("No");

	else

		puts("Yes");

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

#include<cstring>

#include<iostream>

#include<cmath>

#include<algorithm>

using namespace std;



int main()

{

	int n;

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

		int x1=0,y1=0,t1=0,x2,y2,t2;

		int flag=1;

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

			scanf("%d%d%d",&t2,&x2,&y2);

			int s=abs(x2-x1)+abs(y2-y1);

			if(abs(s)>abs(t2-t1)) flag=0;

			s=abs(abs(s)-abs(t1-t2));

			if(s%2!=0){

				flag=0;

			}

			t1=t2;

			x1=x2;

			y1=y2;

			

		}

		if(flag==0){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

		

	}

	

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

#include<cstdlib>

#include<cstring>

#include<iostream>

#include<cmath>

#include<algorithm>

#include<queue>

#include<stack>

using namespace std;

int main()

{

	int n,x[100005],y[100005],t[100005],flag=1;

	cin >> n;

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

	{

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

		if(t[i]<x[i]+y[i])

			flag=0;

		else

		{

			if((x[i]+y[i])%2==0&&t[i]%2!=0)

				flag=0;

			else if((x[i]+y[i])%2!=0&&t[i]%2==0)

				flag=0;

		}

		

	}

		if(flag)

			cout << "Yes";

		else

			cout << "No";

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

#include <set>

#include <queue>

#include <stack>

#include <cmath>

#include <cstdio>

#include <string>

#include <cstring>

#include <iostream>

#include <algorithm>

using namespace std;



#define ls st<<1

#define rs st<<1|1

#define CLR(a,b) memset(a,(b),sizeof(a))



const int MAXN = 1e5+11;

const int mod = 1e9+7;

const int INF = 0x3f3f3f3f;



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

int abc(int x)

{

    if(x < 0) return -x;

    return x;

}

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

int main() {

    int n;

    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;

    bool flag = true;

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

        int tt = (t[i] - t[i-1]);

        int st = abc(x[i]-x[i-1])+abc(y[i]-y[i-1]);

        if(tt<st || st%2 !=tt%2) {

          flag = false; break;

        }



        }

        //if(t[i]==(x[i]-x[i-1]+y[i]-y[i+1]) continue;

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

    else printf("No\n");

return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

using namespace std;

int main()

{

	int n;

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

		int flag=0;

		while(n--){

			int t,x,y;

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

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

				flag=1;

			}

		}

		if(flag){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

		

		

	}

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

#include<cstring>

#include<algorithm>

using namespace std;

struct Node

{

	int t,x,y;

}p[100010];

bool cmp(Node a,Node b)

{

	return a.t <b.t ;

}

int main()

{

	int n;

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

	{

		int f=1;

		memset(p,0,sizeof(p));

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

		{

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

		}

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

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

		{

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

			if((p[i].t-p[i-1].t-ans)%2!=0||(p[i].t-p[i-1].t)<ans)

			f=0;

		}

		if(f)

		printf("Yes\n");

		else

		printf("No\n");

	}

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    long N,x[100005],y[100005],t[100005],z;

	while(scanf("%ld",&N)!=EOF)

	{

		int flag=0;

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

			scanf("%ld%ld%ld",&t[i],&x[i],&y[i]);

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

		{

			z=t[i]-x[i]-y[i];

			if(t[i]<x[i]+y[i])

			{

				printf("No\n");

				flag=1;

				break;

			}

			else if(z%2!=0)

			{

				printf("No\n");

				flag=1;

				break;

			}			

		}

		if(flag==0)

		printf("Yes\n");

	}

	return 0;

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

#include<cstring>

#include<algorithm>

using namespace std;

struct Node

{

	int t,x,y;

}p[100010];

bool cmp(Node a,Node b)

{

	return a.t <b.t ;

}

int main()

{

	int n;

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

	{

		int f=1;

		memset(p,0,sizeof(p));

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

		{

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

		}

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

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

		{

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

			if((p[i].t-p[i-1].t-ans)%2!=0||(p[i].t-p[i-1].t)<ans)

			f=0;

		}

		if(f)

		printf("Yes\n");

		else

		printf("No\n");

	}

	return 0;

}

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

#include<algorithm>

#include<cmath>

#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<string>



using namespace std;



int main(){

    int N,f=1;

    cin>>N;

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

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

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

        if(i==0){

            zz=x[i]+y[i];

            if(zz>t[i]){

                f=0;

            }

            else if(zz==t[i]){



            }

            else{

                zz=t[i]-zz;

                if(zz%2==0){



                }

                else{

                    f=0;

                }

            }



        }

        else{

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

            if(zz>(t[i]-t[i-1])){

                f=0;

            }

            else if(zz==(t[i]-t[i-1])){



            }

            else{

                zz=(t[i]-t[i-1])-zz;

                if(zz%2==0){



                }

                else{

                    f=0;

                }

            }

        }

    }

    if(f){

        cout<<"Yes";

    }

    else{

        cout<<"No";

    }

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

#include<cstring>

#include<algorithm>

using namespace std;

struct Node

{

	int t,x,y;

}p[100010];

bool cmp(Node a,Node b)

{

	return a.t <b.t ;

}

int main()

{

	int n;

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

	{

		int f=1;

		memset(p,0,sizeof(p));

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

		{

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

		}

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

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

		{

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

			if((p[i].t-p[i-1].t-ans)%2!=0||(p[i].t-p[i-1].t)<ans)

			f=0;

		}

		if(f)

		printf("Yes\n");

		else

		printf("No\n");

	}

	return 0;

}

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

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;

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

#include<cstring>

#include<algorithm>

using namespace std;

struct Node

{

	int t,x,y;

}p[100010];

bool cmp(Node a,Node b)

{

	return a.t <b.t ;

}

int main()

{

	int n;

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

	{

		int f=1;

		memset(p,0,sizeof(p));

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

		{

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

		}

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

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

		{

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

			if((p[i].t-p[i-1].t-ans)%2!=0||(p[i].t-p[i-1].t)<ans)

			f=0;

		}

		if(f)

		printf("Yes\n");

		else

		printf("No\n");

	}

	return 0;

}

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

using namespace std;

int main(){

	int N;

	int t,x,y;

	cin>>N;

	int f=1;//能 

	while(N--){

		cin>>t>>x>>y;

		//下面开始判断

		if(x+y>t){

			f=0;

		}

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

			f=0;

		}

		

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	

	return 0;

	

}