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

using namespace std;

struct node

{

	int x,y,t;

}a[102100];

int main()

{

	

	int n;cin>>n;

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

	{

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

	}

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

	int f = 1;

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

	{

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

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

		if( d <= dt && abs(d-dt) %2 == 0)

		{

			continue;

		} 

		else

		{

			f = 0;

			break;

		}

	}

	if(f ) cout<<"Yes\n";

	else cout<<"No\n";

	return 0;

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

int main(){

	int n;

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

	{

		int jin=0;

		int ti[100050]={0};

		int xi[100050]={0};

		int yi[100050]={0};

		int i;

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

		{

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

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

			if(jin!=0)continue;

			if(sum<0){

				sum=-sum;

			}

			if(ti[i]>=sum){

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

				int l2=sum%2;

				if(l1!=l2){

					jin=5;

				}

			}else {

				jin=5;

			}

		}

		if(jin){

			printf("No\n");

		}else {

			printf("Yes\n");

		}

		

	}

	return 0;

}

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

using namespace std;



int main(){

	int n;

	while(cin >> n){

		bool f = true;

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

			int t,x,y;

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

			if(t % 2 == 0){

				if(t < x + y) f = false;

				if((x+y) % 2 != 0) f = false;

			}

			else{

				if(t < x + y) f = false;

				if((x+y) % 2 != 1) f = false;

			}

		}

		if(f)

			printf("Yes\n");

		else 

			printf("No\n");			

	}

	

	return 0;

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

int main(){

	int n;

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

	{

		int jin=0;

		int ti[100050]={0};

		int xi[100050]={0};

		int yi[100050]={0};

		int i;

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

		{

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

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

			if(jin!=0)continue;

			if(sum<0){

				sum=-sum;

			}

			if(ti[i]>=sum){

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

				int l2=sum%2;

				if(l1!=l2){

					jin=5;

				}

			}else {

				jin=5;

			}

		}

		if(jin){

			printf("No\n");

		}else {

			printf("Yes\n");

		}

		

	}

	return 0;

}

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

using namespace std;

int main(){

	int n;

	cin >> n;

	int fg=1;

	int qs=0,qx=0,qy=0;

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

		int s,x,y;

		cin >> s >> x >> y;

		if(s-qs==abs(x-qx)+abs(y-qy)||(s-qs-(abs(x-qx)+abs(y-qy)))%2==0&&s-qs>(abs(x-qx)+abs(y-qy))){

			

		}

		else{

			fg=0;

		}

		qs=s;qx=x;qy=y;

	}

	if(fg)

        printf("Yes\n");

	else

	printf("No\n");

	return 0;

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

int main(){

	int n;

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

	{

		int jin=0;

		int ti[100050]={0};

		int xi[100050]={0};

		int yi[100050]={0};

		int i;

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

		{

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

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

			if(jin!=0)continue;

			if(sum<0){

				sum=-sum;

			}

			if(ti[i]>=sum){

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

				int l2=sum%2;

				if(l1!=l2){

					jin=5;

				}

			}else {

				jin=5;

			}

		}

		if(jin){

			printf("No\n");

		}else {

			printf("Yes\n");

		}

		

	}

	return 0;

}

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

using namespace std;

const int maxn = 1e5 + 10;

int a[maxn], b[maxn], c[maxn];

int main()

{

	int n;

	scanf("%d", &n);

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

		scanf("%d %d %d", a + i, b + i, c + i);

	}

	int flg = 1;

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

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

		if(a[i] - a[i - 1] >= abs(b[i] - b[i - 1]) + abs(c[i] - c[i - 1])){

			if(a[i] - a[i - 1] == abs(b[i] - b[i - 1]) + abs(c[i] - c[i - 1]) || (a[i] - a[i - 1]

			 + abs(b[i] - b[i - 1]) + abs(c[i] - c[i - 1])) % 2 == 0){

			 	flg = 1;

			 }else{

			 	flg = 0;

			 	break;

			 }

		}else{

			flg = 0;

			break;

		}

	}

	if(flg == 1){

		printf("Yes");

	}else{

		printf("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.4073055514805135x):
#include<bits/stdc++.h>

#define ll long long

using namespace std;



int main()

{

    ll n,i,t,a,b,f=0;

    cin>>n;

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

    {

        cin>>t>>a>>b;

        if((a+b)>t)

        {

            f=1;

            continue;

        }

        if((a+b)%2 == 0 && (t%2)!=0)

        {

            f=1;

        }

        else if(((a+b)%2 == 1) && ((t%2)!=1))

        {

            f=1;

        }



    }

    if(f==0)

    {

        cout<<"Yes"<<endl;

    }

    else

    {

        cout<<"No"<<endl;

    }

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

using namespace std;



long long n,m,c,x,y,a,b,t,dt, hasil=0, tag, dist;

int arr[200001];

bool mulai[200001];

bool sel[200001];

bool valid = true;



int main() {

    cin >> m;

    a = 0;

    b = 0;

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

        cin >> t >> x >> y;

        dt = t-hasil;

        dist = (abs(x-a) + abs(y-b));

        if ( (dt-dist)% 2 == 0 && dt >= dist){

            a = x;

            b = y;

            hasil = t;

        }

        else {

            valid = false;

            break;

        }

        

    }

    if(valid == true){

        cout << "Yes" << endl;

    }

    else cout << "No" <<  endl;

   

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

#include <cstdlib>

#include <iomanip>

#include <cmath>

#include <string>

#include <cstring>

#include <algorithm>

#include <vector>

#include <sstream>

#include <set>

#include <queue>

#include <stack>

#include <cctype>

#include <map>

#include <climits>

#include <bitset>

using namespace std;

#define MATH_PI 3.14159265358979323846

int main(){

	ios::sync_with_stdio(false);

	int n;

	cin >> n;

	int x = 0, y = 0;

	int t = 0;

	int a, b, c;

	register int i;

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

		cin >> c >> a >> b;

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

			cout << "No\n";

			goto endapp;

		}

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

			cout << "No\n";

			goto endapp;

		}

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

			cout << "No\n";

			goto endapp;

		}

		x = a;

		y = b;

		t = c;

	}

	cout << "Yes\n";

endapp:

	//system("pause > nul");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.353306443970441x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}
// Slower C++ solution:
    //It is made by Awson on 2018.1.21

    #include <set>

    #include <map>

    #include <cmath>

    #include <ctime>

    #include <queue>

    #include <stack>

    #include <cstdio>

    #include <string>

    #include <vector>

    #include <cstdlib>

    #include <cstring>

    #include <iostream>

    #include <algorithm>

    #define LL long long

    #define Abs(a) ((a) < 0 ? (-(a)) : (a))

    #define Max(a, b) ((a) > (b) ? (a) : (b))

    #define Min(a, b) ((a) < (b) ? (a) : (b))

    #define Swap(a, b) ((a) ^= (b), (b) ^= (a), (a) ^= (b))

    #define writeln(x) (write(x), putchar('\n'))

    #define lowbit(x) ((x)&(-(x)))

    #define y1 yy

    using namespace std;

    const int N = 500000;

    void read(int &x) {

        char ch; bool flag = 0;

        for (ch = getchar(); !isdigit(ch) && ((flag |= (ch == '-')) || 1); ch = getchar());

        for (x = 0; isdigit(ch); x = (x<<1)+(x<<3)+ch-48, ch = getchar());

        x *= 1-2*flag;

    }

    void write(int x) {

        if (x > 9) write(x/10);

        putchar(x%10+48);

    }

     

    int n, t1, x1, y1, t2, x2, y2;

     

    void work() {

        read(n);

        while (n--) {

    	read(t2), read(x2), read(y2);

    	if (t2-t1 < Abs(x2-x1)+Abs(y2-y1)) {printf("No\n"); return; }

    	if ((t2-t1-Abs(x2-x1)+Abs(y2-y1))%2) {printf("No\n"); return; }

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

        }

        printf("Yes\n");

    }

    int main() {

        work();

        return 0;

    }

// Faster C++ solution for the same problem (measured speedup: 5.211918869499447x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

using namespace std;

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

int main(){

	int i,j;

	cin>>n;

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

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

	}

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

		int dt=t[i]-t[i-1];

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

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

		if(dt<0||dt%2){

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.296457158420327x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.294023683962059x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

#include<cmath>

#define fail {cout<<"No"<<endl;return 0;}

using namespace std;

int n,x=0,y=0,t=0,a,b,c;

int main(){

    cin>>n;

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

    {

        cin>>c>>a>>b;

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

	        fail;

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

	        fail;

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

	        fail;

		t=c;

		y=b;

        x=a;

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.293134590189656x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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



using namespace std;



int n;

int x=0,y=0;

int t=0,a,b,c;



int main()

{

	scanf("%d",&n);

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

	{

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

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

		{

			cout<<"No"<<endl;

			return 0;

		}

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

		{

			cout<<"No"<<endl;

			return 0;

		}

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

		{

			cout<<"No"<<endl;

			return 0;

		}

		x=a;

		y=b;

		t=c;

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.248641120231708x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

#include <iostream>

#include <algorithm>

#include <queue>

#include <cstdlib>

#include <cmath>

#include <cstring>

#include <string>

#define inf 1<<30

#define maxn 100010

#define max(x,y) (x>y?x:y)

#define min(x,y) (x<y?x:y)

#define ll long long

inline void read(ll &x){

    x=0;ll f=1;char c=getchar();

    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}

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

    x*=f;

}

using namespace std;

ll n,pt,px,py;

ll t=0,x=0,y=0,nt,nx,ny,k;

int main(){

	read(n);

	ll i;

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

		read(nt);read(nx);read(ny);

		pt=nt-t;px=abs(nx-x);py=abs(ny-y);

		k=pt-px-py;

		if(k&1||k<0){

			printf("No\n");

			return 0;

		}

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

	}

	printf("Yes\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.212855230297649x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.281017783299416x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

using namespace std;

int main()

{

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

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

	{

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

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

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

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

	}

	printf("Yes\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.222367352349973x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

const int N=100001;

using namespace std;

int main(){

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

	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;

}

// Faster C++ solution for the same problem (measured speedup: 5.40352778238953x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

using namespace std;

int n,ti,a,b;

int main()

{

    cin>>n;

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

    {

        cin>>ti>>a>>b;

        if(!(a+b<=ti&&(ti-a-b)%2==0))

        {

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.250719968489037x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

#include <cstring>

using namespace std;

int main()

{

    int n;

    cin >> n;

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

    {

        int t,a,b;

        cin >> t >> a >> b;

        if(a+b>t||(a+b)%2!=t%2)

        {

            cout << "No" << endl;

            return 0;

        }

    }

    cout << "Yes" << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.294115355546985x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

using namespace std;

int main()

{

    int n,x,y,t;

    cin>>n;

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

	{

        cin>>t>>x>>y;

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

        {cout<<"No"<<endl;return 0;}

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2940321260591965x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

const int N=100001;

using namespace std;

int main(){

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

    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;

}

// Faster C++ solution for the same problem (measured speedup: 5.40352778238953x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

using namespace std;

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



int main() {

	scanf("%d",&n);

	for(int i=1; i<=n; i++) scanf("%d%d%d",&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) { 

			printf("No");

			return 0;

		}

	printf("Yes");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.22465517520461x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

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

const int N=100001;

using namespace std;

int main(){

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

    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){//判断，如果不行直接输出“No”

        cout<<"No";

            return 0;   

            }

            cout<<"Yes";

            return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.403700503919095x):
#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!=t%2)

        {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}