stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.306781397037486x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.245069839322897x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.305158258185765x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.233809094216649x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.294738065827655x):
#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;

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

}

// Faster C++ solution for the same problem (measured speedup: 5.304758985801842x):
#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;

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

using namespace std;

int main()

{

	int N,t,x,y;

	cin>>N;

	int flag=0;

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

	{

	   cin>>t>>x>>y;

	   int tmp=x+y;

	   if(tmp>t) flag=1;

	   else

	   	   if((t-tmp)%2==1) flag=1;

	}

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

	else cout<<"No"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.306582816505342x):
#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;

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

using namespace std;

int main() {

    int n,a,b,c,f=1;

    scanf("%d",&n);

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

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

        if(a<b+c||(a-b-c)&1){f=0;break;}

    }

    if(f)printf("Yes");

    else printf("No");

}

// Faster C++ solution for the same problem (measured speedup: 5.233713531521791x):
#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;

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

using namespace std;



int main(){

	int n;

	cin>>n;

	int t[n+10],x[n+10],y[n+10];

	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"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

} 


// Faster C++ solution for the same problem (measured speedup: 5.307416642152305x):
#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;

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

using namespace std;

int n,t,x,y;

int main() {

	ios::sync_with_stdio(false);

	cin >> n;

	while(n--) {

		cin >> t >> x >> y;

		if(x + y > t || t - x - y & 1) {

			cout << "No\n";

			return 0;

		}

	}

	cout << "Yes\n";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.364959974403234x):
#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;

}
// 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.415057119131735x):
#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;

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

#include <algorithm>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <iomanip>

using namespace std;

int sx,sy,x,y,n,sm,m,flag = 1;



int main()

{

    cin>>n;

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

    {

        cin>>m>>x>>y;

        if(x == sx && y == sy)

        {

            if((m - sm) % 2)flag = 0;

        }

        else

        {

            int d = abs(x - sx) + abs(y - sy);

            if(!((m - sm) && (m - sm) % d == 0 && ((m - sm) / d) % 2))flag = 0;

        }

        sx = x,sy = y,sm = m;

    }

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

    else cout<<"No"<<endl;

}


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

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;



int n,x,y,t,ti,xi,yi;



int main()

{

    scanf("%d",&n);

    x = 0, y = 0, t = 0;

    bool ans = 1;

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

    {

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



        int ned = abs(x-xi)+abs(y-yi);

        if (ned > ti-t) ans = 0;



        int tag = (ti-t)-ned;

        if (tag % 2) ans = 0;



        x = xi, y = yi, t = ti;

    }

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

    else

        printf("No\n");

    return 0;

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

#include <cmath>



using namespace std;

int main(){

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

	cin >> n;

	for (int i = 0, tt, tx, ty; i<n; i++){

		cin >> tt >> tx >> ty;

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

			flag = 1;

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

	}

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

	else cout << "No" << endl;



	return 0;

}

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

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;



int n,x,y,t,ti,xi,yi;



int main()

{

    scanf("%d",&n);

    x = 0, y = 0, t = 0;

    bool ans = 1;

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

    {

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



        int ned = abs(x-xi)+abs(y-yi);

        if (ned > ti-t) ans = 0;



        int tag = (ti-t)-ned;

        if (tag % 2) ans = 0;



        x = xi, y = yi, t = ti;

    }

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

    else

        printf("No\n");

    return 0;

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

using namespace std;

int main()

{

    int n,dis,x,y;

    scanf("%d",&n);

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

    {

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

        if(dis<(x+y))

        {

            printf("No");

            return 0;

        }

        else

        {

            if((x+y)%2==0)

            {

                if(dis%2==0)

                    continue;

                else

                {

                    printf("No");

                    return 0;

                }

            }

            else

            {

                if(dis%2==0)

                {

                    printf("No");

                    return 0;

                }

                else

                    continue;

            }

        }



    }

    printf("Yes");

    return 0;

}


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

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;



int n,x,y,t,ti,xi,yi;



int main()

{

    scanf("%d",&n);

    x = 0, y = 0, t = 0;

    bool ans = 1;

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

    {

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



        int ned = abs(x-xi)+abs(y-yi);

        if (ned > ti-t) ans = 0;



        int tag = (ti-t)-ned;

        if (tag % 2) ans = 0;



        x = xi, y = yi, t = ti;

    }

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

    else

        printf("No\n");

    return 0;

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

#include <cstring>

#include <iostream>

#include <algorithm>

#define MAXN 100005

using namespace std ;



int n,x,y,t;



struct DATA{

	int x,y,t;

	bool operator <(const DATA v)const{return t<v.t;}

} A[MAXN];



inline int red(){

	int Res; char ch; bool flg; Res=flg=0;

	while (ch=getchar(),ch<48||57<ch) flg^=!(ch^'-'); Res=(ch&15);

	while (ch=getchar(),47<ch&&ch<58) Res=(Res<<1)+(Res<<3)+(ch&15);

	if (flg) return -Res; return Res;

}



int abs_(int x){

	if (x<0) return -x; return x;

}



int get(int x,int y,int x_,int y_){

	return abs_(x-x_)+abs_(y-y_);

}



int main(){

	n=red();

	for (int i=1;i<=n;i++) A[i].t=red(),A[i].x=red(),A[i].y=red();

	sort(A+1,A+1+n);

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

		int len=get(x,y,A[i].x,A[i].y);

		if (!(len<=A[i].t-t&&(len&1)==((A[i].t-t)&1))){

			puts("No");

			return 0;

		}

	}

	puts("Yes");

	return 0 ;

}

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

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;



int n,x,y,t,ti,xi,yi;



int main()

{

    scanf("%d",&n);

    x = 0, y = 0, t = 0;

    bool ans = 1;

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

    {

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



        int ned = abs(x-xi)+abs(y-yi);

        if (ned > ti-t) ans = 0;



        int tag = (ti-t)-ned;

        if (tag % 2) ans = 0;



        x = xi, y = yi, t = ti;

    }

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

    else

        printf("No\n");

    return 0;

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

using namespace std;



int n, t, x, y, px, py, pt;



int main() {

	scanf("%d", &n);

	while (n--) {

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

		int md = abs(px - x) + abs(py - y);

		if (md > t - pt) {

			puts("No");

			return 0;

		}

		if (md % 2 != (t - pt) % 2) {

			puts("No");

			return 0;

		}

		px = x; py = y; pt = t;

	}

	puts("Yes");

}

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

#include<string.h>

#include<math.h>

#include<algorithm>

using namespace std;



int n,x,y,t,ti,xi,yi;



int main()

{

    scanf("%d",&n);

    x = 0, y = 0, t = 0;

    bool ans = 1;

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

    {

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



        int ned = abs(x-xi)+abs(y-yi);

        if (ned > ti-t) ans = 0;



        int tag = (ti-t)-ned;

        if (tag % 2) ans = 0;



        x = xi, y = yi, t = ti;

    }

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

    else

        printf("No\n");

    return 0;

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

#include <algorithm>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <iomanip>

using namespace std;

int sx,sy,x,y,n,sm,m,flag = 1;



int main()

{

    cin>>n;

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

    {

        cin>>m>>x>>y;

        if(x == sx && y == sy)

        {

            if((m - sm) % 2)flag = 0;

        }

        else

        {

            int d = abs(x - sx) + abs(y - sy);

            if(!((m - sm) && (m - sm) % d == 0 && ((m - sm) / d) % 2))flag = 0;

        }

        sx = x,sy = y,sm = m;

    }

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

    else cout<<"No"<<endl;

}


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

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

int a[100001];

int b[100001],c[100001];

int main()

{

	int n;

	scanf("%d",&n);

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

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

	{

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

	}

	int flag=1;

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

	{

		int s=a[i]-a[i-1];

		int x=(b[i]-b[i-1])+(c[i]-c[i-1]);

		if(s-x==0||(s-x)%2==0&&s-x>0)

		{

			continue;

		}

		else

		{

			flag=0;

			break;

		}

	}	

	if(flag)

	printf("Yes\n");

	else

	printf("No\n");

	return 0;

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

#include <cmath>



using namespace std;

int main(){

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

	cin >> n;

	for (int i = 0, tt, tx, ty; i<n; i++){

		cin >> tt >> tx >> ty;

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

			flag = 1;

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

	}

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

	else cout << "No" << endl;



	return 0;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

int a[100001];

int b[100001],c[100001];

int main()

{

	int n;

	scanf("%d",&n);

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

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

	{

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

	}

	int flag=1;

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

	{

		int s=a[i]-a[i-1];

		int x=(b[i]-b[i-1])+(c[i]-c[i-1]);

		if(s-x==0||(s-x)%2==0&&s-x>0)

		{

			continue;

		}

		else

		{

			flag=0;

			break;

		}

	}	

	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,dis,x,y;

    scanf("%d",&n);

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

    {

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

        if(dis<(x+y))

        {

            printf("No");

            return 0;

        }

        else

        {

            if((x+y)%2==0)

            {

                if(dis%2==0)

                    continue;

                else

                {

                    printf("No");

                    return 0;

                }

            }

            else

            {

                if(dis%2==0)

                {

                    printf("No");

                    return 0;

                }

                else

                    continue;

            }

        }



    }

    printf("Yes");

    return 0;

}


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

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

int a[100001];

int b[100001],c[100001];

int main()

{

	int n;

	scanf("%d",&n);

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

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

	{

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

	}

	int flag=1;

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

	{

		int s=a[i]-a[i-1];

		int x=(b[i]-b[i-1])+(c[i]-c[i-1]);

		if(s-x==0||(s-x)%2==0&&s-x>0)

		{

			continue;

		}

		else

		{

			flag=0;

			break;

		}

	}	

	if(flag)

	printf("Yes\n");

	else

	printf("No\n");

	return 0;

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

#include <cstring>

#include <iostream>

#include <algorithm>

#define MAXN 100005

using namespace std ;



int n,x,y,t;



struct DATA{

	int x,y,t;

	bool operator <(const DATA v)const{return t<v.t;}

} A[MAXN];



inline int red(){

	int Res; char ch; bool flg; Res=flg=0;

	while (ch=getchar(),ch<48||57<ch) flg^=!(ch^'-'); Res=(ch&15);

	while (ch=getchar(),47<ch&&ch<58) Res=(Res<<1)+(Res<<3)+(ch&15);

	if (flg) return -Res; return Res;

}



int abs_(int x){

	if (x<0) return -x; return x;

}



int get(int x,int y,int x_,int y_){

	return abs_(x-x_)+abs_(y-y_);

}



int main(){

	n=red();

	for (int i=1;i<=n;i++) A[i].t=red(),A[i].x=red(),A[i].y=red();

	sort(A+1,A+1+n);

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

		int len=get(x,y,A[i].x,A[i].y);

		if (!(len<=A[i].t-t&&(len&1)==((A[i].t-t)&1))){

			puts("No");

			return 0;

		}

	}

	puts("Yes");

	return 0 ;

}

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

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

int a[100001];

int b[100001],c[100001];

int main()

{

	int n;

	scanf("%d",&n);

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

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

	{

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

	}

	int flag=1;

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

	{

		int s=a[i]-a[i-1];

		int x=(b[i]-b[i-1])+(c[i]-c[i-1]);

		if(s-x==0||(s-x)%2==0&&s-x>0)

		{

			continue;

		}

		else

		{

			flag=0;

			break;

		}

	}	

	if(flag)

	printf("Yes\n");

	else

	printf("No\n");

	return 0;

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

using namespace std;



int n, t, x, y, px, py, pt;



int main() {

	scanf("%d", &n);

	while (n--) {

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

		int md = abs(px - x) + abs(py - y);

		if (md > t - pt) {

			puts("No");

			return 0;

		}

		if (md % 2 != (t - pt) % 2) {

			puts("No");

			return 0;

		}

		px = x; py = y; pt = t;

	}

	puts("Yes");

}

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

#include<string.h>

#include<algorithm>

using namespace std;

const int mod=1e9+7;

int a[100001];

int b[100001],c[100001];

int main()

{

	int n;

	scanf("%d",&n);

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

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

	{

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

	}

	int flag=1;

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

	{

		int s=a[i]-a[i-1];

		int x=(b[i]-b[i-1])+(c[i]-c[i-1]);

		if(s-x==0||(s-x)%2==0&&s-x>0)

		{

			continue;

		}

		else

		{

			flag=0;

			break;

		}

	}	

	if(flag)

	printf("Yes\n");

	else

	printf("No\n");

	return 0;

}