stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#define _CRT_SECURE_NO_WARNINGS



#include<iostream>

#include<string>



using namespace std;



int N;

// 現在の場所

int now_t, now_x, now_y;

// 次に行く場所

int t, x, y;



int main() {

	int N;

	scanf("%d", &N);



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

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



		// まず最低限必要な時間

		int rest_t = t - now_t - (abs(x - now_x) + abs(y - now_y));

		if (rest_t < 0 || rest_t % 2 == 1) {

			printf("No\n");

			return 0;

		}



		// 更新

		now_t = t;

		now_x = x;

		now_y = y;

	}



	printf("Yes\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#define _CRT_SECURE_NO_WARNINGS

#include<cstdio>

#include<cstdlib>



using namespace std;



template<class T> void gc(T &x)

{

	char c;

	int s = 0;

	x = 0;



	c = getchar_unlocked();



	if (c == '-') s = 1;

	else if ('0' <= c && c <= '9')  x = c - '0';



	while (true)

	{

		c = getchar_unlocked();



		if (c < '0' || c > '9') break;

		x = x * 10 + (c - '0');

	}



	if (s) x = -x;

}

int N;

// 現在の場所

int now_t, now_x, now_y;

// 次に行く場所

int t, x, y;



int main() {

	int N;

	gc(N);



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

		gc(t);

		gc(x);

		gc(y);



		// まず最低限必要な時間

		int rest_t = t - now_t - (abs(x - now_x) + abs(y - now_y));

		if (rest_t < 0 || rest_t % 2 == 1) {

			printf("No\n");

			return 0;

		}



		// 更新

		now_t = t;

		now_x = x;

		now_y = y;

	}



	printf("Yes\n");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>//AT3875

#include<cstdio>

#include<cstring>

#include<string>

#include<iomanip>

#include <algorithm>

#include<cmath>

#include<vector>

#include<queue>

#include<set>

using namespace std;

int main()

{

	int n,j,k,l,i;

	cin>>n;

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

	 {

	 	cin>>j>>k>>l;

	 	if(k+l>j){cout<<"No";return 0;}

	 	k=(k+l)%2;l=j%2;

	 	if(k!=l){cout<<"No";return 0;}

	 }

	 cout<<"Yes";

	 return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

int n,t,x,y;

int main()

{

    scanf("%d",&n);

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

    {

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

        if(x+y>t)

        {

            printf("No\n");

            return 0;

        }

        if(!((x+y)&1)&&t&1)

        {

            printf("No\n");

            return 0;

        }

        if((x+y)&1&&!(t&1))

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cmath>

#include <algorithm>

using namespace std;

inline int read(){

	int x,t=1;

	char c;

	while(c=getchar(),c<'0' || c>'9')if(c=='-')t=-1;

	x=c-'0';

	while(c=getchar(),c>='0' && c<='9')x=x*10+c-'0';

	return x*t;

}

int main(){

	int n;

	bool flag=1;

	n=read(); 

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

		int t,x,y;

		t=read();

		x=read();

		y=read();

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

			flag=0;

	}

	if(flag==1)

		cout<<"Yes";

	else cout<<"No";

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

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

    {

        cin>>c>>a>>b;

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

    }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,t,x,y;

    cin>>n;

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

    {

        cin>>t>>x>>y;

        if(x+y>t)

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

    }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

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

    {

        cin>>c>>a>>b;

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

    }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,t,x,y;

int main(){

    cin>>n;

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

        cin>>t>>x>>y;

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

            cout<<"No\n";

            return 0;

        }

    }

    cout<<"Yes\n";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int n;

long long t,x,y;

int main(){

	cin>>n;

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

		cin>>t>>x>>y;

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

			cout<<"No"<<endl;

			return 0;

		}

		else continue;

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstdio>

using namespace std;

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

int main()

{

	cin>>n;

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

	{

		cin>>t>>x>>y;

		nowtime=t-alltime;

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

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

		alltime=t;

	}

	cout<<"Yes\n";

	return 0;

}

// Optimized solution to the same problem (faster):


#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

        if(x+y>t)//???,???????????

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//??????????????,?????

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//????No??return 0?,???????Yes?

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cmath>

using namespace std;



int x,y,t;

int n,a,b,c;



int main()

{

	cin>>n;

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

		cin>>c>>a>>b;

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

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

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

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):


#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

        if(x+y>t)//???,???????????

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//??????????????,?????

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//????No??return 0?,???????Yes?

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

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

    {

        cin>>c>>a>>b;

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

    }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):


#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

        if(x+y>t)//???,???????????

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//??????????????,?????

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//????No??return 0?,???????Yes?

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

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

    {

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

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

        {

            printf("No");

            return 0;

        }

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

        {

            printf("No");

            return 0;

        }

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

        {

            printf("No");

            return 0;

        }

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

    }

    printf("Yes");

    return 0;

}

// Optimized solution to the same problem (faster):


#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

        if(x+y>t)//???,???????????

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//??????????????,?????

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//????No??return 0?,???????Yes?

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;cin>>n;

    while(n--)

    {

        int t,x,y;

        cin>>t>>x>>y;

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

    }

	puts("Yes");

    return 0;

}

// Optimized solution to the same problem (faster):


#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

        if(x+y>t)//???,???????????

        {

            printf("No\n");

            return 0;

        }

        if((x+y)%2==0&&t%2==1)//??????????????,?????

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");//????No??return 0?,???????Yes?

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>//懒人专用头文件

#define inr int

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

using namespace std;

inline int read()//快读

{

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

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

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

	return t?-x:x;

}

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

main()

{

	n=read();

	rpt(n)

	{

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

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

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

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

	}

	puts("Yes");

}/**/

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<iomanip>

#include<cstring>

#include<cstdio>

#include<cmath>

#include<algorithm>

#include<set>

using namespace std;

int t,x,y,n;

int bj=1;

int main() {

	cin>>n;

	while(n--){

		cin>>t>>x>>y;

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

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

	}

	if(bj)puts("Yes");

	else puts("No");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,t,x,y;

int main(){

    scanf("%d",&n);

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

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

        if (x+y>t){

            printf ("No\n");

            return 0;

        }

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

            printf("No\n");

            return 0;

        }

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

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

	int a,b,n,tol,tim;

	cin>>n;

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

		cin>>tim>>a>>b;

		tol=a+b;

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

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

} 

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	int n;bool flag=1;

	cin>>n;

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

		int t,x,y;

		cin>>t>>x>>y;

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

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

	}

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

	else cout<<"No"<<endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,a,b,c;

int main()

{

	scanf("%d",&n);

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

	{

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

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

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

		{

			cout<<"No\n";

			return 0;

		}

		if(b+c>a)

		{

			cout<<"No\n";

			return 0;

		}

	}

	cout<<"Yes\n";

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main() {

	int n,x,y,t;

	cin>>n;

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

		cin>>t>>x>>y;

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

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

	int a,b,c,d,e;

	scanf("%d",&a);

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

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

		if(c<d+e){

			printf("No");

			return 0;

		}

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

			printf("No");

			return 0;

		}

	}

	printf("Yes");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// luogu-judger-enable-o2

#include<iostream>

const int N=100001;

using namespace std;

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

int main(){

    cin>>n;

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

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

    }

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

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

            cout<<"No";

            return 0;   

            }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

	int n,t,x,y;

	scanf("%d",&n);

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

	{

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

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

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

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

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,t,x,y;

int main(){

    cin>>n;

    while(n--){

        cin>>t;

        cin>>x>>y;

        if(x+y<=t&&(t-x-y)%2==0) continue;

        cout<<"No"<<endl;

        exit(0);

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

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

        {

            printf("No\n");

            return 0;

        }

    }

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

    return 0;

}


// Fastest known solution for this problem: