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

#define N 100000

using namespace std;

bool flag=1;

int n,a[N|1],b[N|1],c[N|1];

int main() {

	scanf("%d",&n);

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

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

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

			flag=0;

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

			flag=0;

	}

	if(flag)	puts("Yes");

	else		puts("No");

	return 0;

}


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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;



/*

<url:https://arc089.contest.atcoder.jp/tasks/arc089_a>

問題文============================================================

 シカのAtCoDeerくんは二次元平面上で旅行をしようとしています。

 AtCoDeerくんの旅行プランでは、時刻 0 に 点 (0,0) を出発し、

 1 以上 N 以下の各 i に対し、時刻 ti に 点 (xi,yi) を訪れる予定です。

 

 AtCoDeerくんが時刻 t に 点 (x,y) にいる時、

 時刻 t+1 には 点 (x+1,y), (x−1,y), (x,y+1), (x,y−1) のうちいずれかに存在することができます。

 その場にとどまることは出来ないことに注意してください。

 AtCoDeerくんの旅行プランが実行可能かどうか判定してください。



=================================================================



解説=============================================================



 次地点に時間が間に合わない時はいうまでもなく no

 時間が間に合う時、

     シカは同一地点に留まることができないので、

     次地点に到達した時の残り時間が偶数のとき、時間ぴったしに到達できる

 

================================================================

*/

struct plan{

    int t,x,y;

    plan():t(0),x(0),y(0){}

};

int main(void) {

	cin.tie(0); ios::sync_with_stdio(false);

    ll N; cin >> N;

    vector<plan> P(N+1);

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

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

        int diff = abs(P[i].x - P[i-1].x) + abs(P[i].y - P[i-1].y);

        if(diff > P[i].t - P[i-1].t){

            cout << "No" << endl;

            return 0;

        }else{

            if((P[i].t - P[i-1].t - diff )% 2 != 0){

                cout << "No" << endl;

                return 0;

            }

        }

    }

    cout << "Yes" << endl;

	return 0;

}


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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

#include<cstring>

#include<cstdio>

#include<algorithm>

using namespace std;

const int maxn = 1010;

const int INF = 0x3f3f3f3f;

int main()

{

    int n;

    cin>>n;

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

    while(n--){

        int t,x,y;

        cin>>t>>x>>y;

        int need = abs(nx-x)+abs(ny-y);

//        cout<<need<<endl;

        if(need <= (t-nt) && ((t-nt)-need)%2==0){

            nt=t;

            nx=x;

            ny=y;

        }

        else{

            flag = 1;

        }

    }

    if(!flag)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;



    return 0;

}


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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

#include <set>

#include <stack>

#include <queue>

#include <vector>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <iostream>

#include <algorithm>

#define ll long long

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

using namespace std;



const int MAXN=1e5+100;

const int INF=0x3FFFFFFF;

const ll MOD=1e9+7;



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



int main()

{

    int n;

    cin>>n;

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

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

    bool flag=1;

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

    {

        int disx=abs(x[i]-x[i-1]);

        int disy=abs(y[i]-y[i-1]);

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

        if(disx+disy>dist||(dist-disx-disy)%2!=0)

        {

            flag=0;

            break;

        }

    }

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

    else    cout<<"No"<<endl;

    return 0;

}

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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

#include<cstdlib>

#include<cstring>

#include<cmath>

#include<iostream>

#include<algorithm>

using namespace std;

int main()

{

	int n,k,f,x,y,t,t1,t2;

	cin>>n;

	int a,b;

	a=b=0;

	f=1;

	t1=0;

	while(n--)

	{

		cin>>t2>>x>>y;

		t=t2-t1;

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

		if(k<=t)

		{

			a=x;

			b=y;

		}

		else

		{

			f=0;

		}

		if(t%2!=k%2)

		{

			f=0;

		}

		t1=t2;

	}

	if(f)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

return 0;

}

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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;



int main()

{

	int n;

	cin >> n;

	int T[100000+521],X[100000+521],Y[100000+521];

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

	{

		cin >> T[i] >> X[i] >> Y[i];

	}

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

	{

		if(T[i]<X[i]+Y[i])

		{

			cout << "No";

			break;

		}

		if(T[i]>X[i]+Y[i]&&(X[i]+Y[i])%2!=T[i]%2)

		{

			cout << "No";

			break;

		}

		if(i==n)

			cout <<"Yes";

	}

	

	

	return 0;

}

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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

#include<cstdio>

#include<cstring>

#include<algorithm>

const int Max = 1E5 + 10;

using namespace std;

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

int main()

{

    int T,X,Y,S,f=0;

    cin>>N;

    t[0]=0;

    x[0]=0;

    y[0]=0;

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

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

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

    {

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

    	X=x[i]-x[i-1];

    	Y=y[i]-y[i-1];

    	S=T-(X+Y);

    	if(S<0)

    	{

    		f=1;

		}

		else

		{

			if(S&1) 

			{

				f=1;

			}

			else

			    f=0;

		}

		if(f==1) break;

	}

	if(f==1) cout<<"No"<<endl;

	else if(f==0) cout<<"Yes"<<endl;

	return 0;

}


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

#include<stack>

#include<queue>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int zuo=0;

	int bushu=0;

	int you=0;

	int f=1;

	int a,b,c;

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

	{

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

		if(f==0)

		continue;

		int g,h;

		g=abs(b-zuo);

		h=abs(c-you);

		bushu=a-bushu;

		if(b==zuo&&c==you&&bushu%2!=0)

	    {

		   f=0;

		}

		else if((g+h)>bushu)

		{

		   f=0;

	    }

		else if(bushu%2==0&&(g+h)%2!=0)

		{

		   f=0;

		}

		else if(bushu%2!=0&&(g+h)%2==0)

		{

			f=0;

		}

		else

		{

		   zuo=b;

		   you=c;

		   bushu=a;

		}

	}

	if(f==0)

	printf("No\n");

	else if(f==1)

	printf("Yes\n");

	return 0;

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

#include<cmath>

using namespace std;

struct Node{

	int x;

	int y;

	int t;

}N[100005];

int main()

{

 	int n,x,y,t,i,j;

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

	cin>>n;

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

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

	}

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

		x = N[i].x-N[i-1].x;

		if(x<0){

			x = (-1)*x;

		}

		y = N[i].y-N[i-1].y;

		if(y<0){

			y = (-1)*y;

		}

		if( (((N[i].t-N[i-1].t)-x-y)<0) || (((N[i].t-N[i-1].t)-x-y)%2 !=0)){

			cout<<"No";

			return 0;

		}

	}

	cout<<"Yes";

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    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,t=0,x=0,y=0,f=0;

    cin>>n;

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

    {

        cin>>tt>>tx>>ty;

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

            f=1;

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

    }

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

    else cout<<"No";

    return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    if(flag)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

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

#include <cstdio>

#include <cstring>

#include <cmath>

using namespace std;

const int MAXN = 100010;

struct node{

    int x,y,t;

}plan[MAXN];



int main(){

    int n;

    int i;

    scanf("%d",&n);

    plan[0].t = 0;

    plan[0].x = 0;

    plan[0].y = 0;

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

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

    }

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

        int mint = abs(plan[i].x-plan[i-1].x)+abs(plan[i].y-plan[i-1].y);

        int realt = plan[i].t-plan[i-1].t;

        if(mint % 2 != realt % 2 || realt<mint)

            break;

    }

    if(i > n)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    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, lastt = 0, lastx = 0, lasty = 0;

	bool flag = true;

	cin >> n;

	while (n--) {

		int t, x, y;

		cin >> t >> x >> y;

		if (t - lastt < abs(lastx - x) + abs(lasty - y)) {

			flag = false;

		} else if ((t - lastt) % 2 != (abs(lastx - x) + abs(lasty - y)) % 2) {

			flag = false;

		}

		lastt = t, lastx = x, lasty = y;

	}

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

	return 0;

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    if(flag)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

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

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <climits>

#include <cstring>

#include <string>

#include <vector>

#include <list>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <bitset>

#include <algorithm>

#include <functional>

#include <iomanip>

using namespace std;



#define LL long long

const int maxn = 100000 + 100;

int n;

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



int main() {

    #ifdef LOCAL

        freopen("test.txt", "r", stdin);

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

    #endif // LOCAL

    ios::sync_with_stdio(false);



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

        bool flag = true;

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

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

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

        }

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

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

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

            if(tmp > tt || tmp % 2 != tt % 2) {

                flag = false;

                break;

            }

        }

        if(flag) {

            printf("Yes\n");

        } else {

            printf("No\n");

        }

    }



    return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    if(flag)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

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

#include <iostream>

#include <vector>

#include <queue>

#include <cstring>

#include <algorithm>

#include <set>

#include <string>

using namespace std;

int n,k,t,m,x,y,x1,y1,t1;

int main()

{

    scanf("%d",&n);

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

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

    {

        scanf("%d%d%d",&t1,&x1,&y1);

        m=abs(x-x1)+abs(y-y1);

        if(t1-t<m||(t1-t-m)%2==1)

        {

            printf("No\n");

            return 0;

        }

        x=x1;

        y=y1;

        t=t1;

    }

    printf("Yes\n");

    return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    if(flag)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

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

#include <algorithm>

#include <stdio.h>

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

using namespace std;

const int maxn=1e5+10;

const int maxx=1e13+10;

int x[maxn];

int y[maxn];

int t[maxn];

int n;

int dis(int i)

{

    int disx=x[i]-x[i-1];

    int disy=y[i]-y[i-1];

    if(disx<=0) disx=-disx;

    if(disy<=0) disy=-disy;

    int diss=disx+disy;

    if(t[i]-t[i-1]<diss) return 0;

    else if(t[i]-t[i-1]==diss) return 1;

    else 

    {

        if((t[i]-t[i-1]-diss)%2==0) return 1;

        else return 0;

    }

}

int main()

{

	scanf("%d",&n);

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

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

    int flag=1; 

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

    {

        if(dis(i)==1) continue;

        else 

        {

            flag=0; break;

        }

    }

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

    else printf("No\n" );

}

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

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int pt=0,px=0,py=0;

    int flag=1;

    while(n--)

    {

        int t,x,y;

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

        if(t-pt<abs(x-px)+abs(y-py))

            flag=0;

        else if((t-pt-(abs(x-px)+abs(y-py)))%2==1)

            flag=0;

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

    }

    if(flag)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

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

#include<cmath>

using namespace std;

struct Node{

	int x;

	int y;

	int t;

}N[100005];

int main()

{

 	int n,x,y,t,i,j;

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

	cin>>n;

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

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

	}

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

		x = N[i].x-N[i-1].x;

		if(x<0){

			x = (-1)*x;

		}

		y = N[i].y-N[i-1].y;

		if(y<0){

			y = (-1)*y;

		}

		if( (((N[i].t-N[i-1].t)-x-y)<0) || (((N[i].t-N[i-1].t)-x-y)%2 !=0)){

			cout<<"No";

			return 0;

		}

	}

	cout<<"Yes";

	return 0;

}

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

#include<cmath>

#include<malloc.h>

#include<stdlib.h>

#include<cstring>

#include<algorithm>

int main()

{

	int n;

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

	{

		int t,x,y;

		int a=0,b=0;

		while(n--)

		{

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

			if(((t%2)==(x+y)%2)&&t>=x+y)

			a=1;

			else

			b=1;

		}

		if(b==1)

		puts("No");

		else puts("Yes");

	}

	return 0;

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

}

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

#include<cmath>

#include<malloc.h>

#include<stdlib.h>

#include<cstring>

#include<algorithm>

int main()

{

	int n;

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

	{

		int t,x,y;

		int a=0,b=0;

		while(n--)

		{

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

			if(((t%2)==(x+y)%2)&&t>=x+y)

			a=1;

			else

			b=1;

		}

		if(b==1)

		puts("No");

		else puts("Yes");

	}

	return 0;

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

#include <cstdio>

#include <cstring>

#include <cmath>

using namespace std;

const int MAXN = 100010;

struct node{

    int x,y,t;

}plan[MAXN];



int main(){

    int n;

    int i;

    scanf("%d",&n);

    plan[0].t = 0;

    plan[0].x = 0;

    plan[0].y = 0;

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

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

    }

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

        int mint = abs(plan[i].x-plan[i-1].x)+abs(plan[i].y-plan[i-1].y);

        int realt = plan[i].t-plan[i-1].t;

        if(mint % 2 != realt % 2 || realt<mint)

            break;

    }

    if(i > n)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

}


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

#include<cmath>

#include<malloc.h>

#include<stdlib.h>

#include<cstring>

#include<algorithm>

int main()

{

	int n;

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

	{

		int t,x,y;

		int a=0,b=0;

		while(n--)

		{

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

			if(((t%2)==(x+y)%2)&&t>=x+y)

			a=1;

			else

			b=1;

		}

		if(b==1)

		puts("No");

		else puts("Yes");

	}

	return 0;

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

using namespace std;



int main() {

	int n, lastt = 0, lastx = 0, lasty = 0;

	bool flag = true;

	cin >> n;

	while (n--) {

		int t, x, y;

		cin >> t >> x >> y;

		if (t - lastt < abs(lastx - x) + abs(lasty - y)) {

			flag = false;

		} else if ((t - lastt) % 2 != (abs(lastx - x) + abs(lasty - y)) % 2) {

			flag = false;

		}

		lastt = t, lastx = x, lasty = y;

	}

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

	return 0;

}

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

#include<cmath>

#include<malloc.h>

#include<stdlib.h>

#include<cstring>

#include<algorithm>

int main()

{

	int n;

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

	{

		int t,x,y;

		int a=0,b=0;

		while(n--)

		{

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

			if(((t%2)==(x+y)%2)&&t>=x+y)

			a=1;

			else

			b=1;

		}

		if(b==1)

		puts("No");

		else puts("Yes");

	}

	return 0;

}