stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<string>

#include<vector>

#include<list>

#include<stack>

#include<queue>

#include<map>

#include<algorithm>

#include<numeric>



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

#define REP(i, n) for (int i = 0; i < (n); i++)



using namespace std;



using ll = long long;

using pii = pair<int, int>;

using vi = vector<int>;



const int mod = 1e9 + 7;

const long double pi = 3.141592653589793238462643383279502884197;

const long double eps = 1e-7;



int main() {

	int N;

	cin >> N;



	int pre_t = 0, pre_x = 0, pre_y = 0;

	int t, x, y;

	REP(i, N) {

		cin >> t >> x >> y;



		int rest_t = t - pre_t;

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

		rest_t -= abs(x - pre_x) + abs(y - pre_y);

		if (rest_t < 0) {

			cout << "No" << endl;

			return 0;

		}

		else if (rest_t % 2 == 1) {

			cout << "No" << endl;

			return 0;

		}



		// update

		pre_t = t;

		pre_x = x;

		pre_y = y;

	}



	cout << "Yes" << endl;

	return 0;

}

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

}
// Slower C++ solution:
#define _CRT_SECURE_NO_WARNINGS



#include<iostream>

#include<string>

#include<vector>

#include<list>

#include<stack>

#include<queue>

#include<map>

#include<algorithm>

#include<numeric>



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

#define REP(i, n) for (int i = 0; i < (n); i++)



using namespace std;



using ll = long long;

using pii = pair<int, int>;

using vi = vector<int>;



const int mod = 1e9 + 7;

const long double pi = 3.141592653589793238462643383279502884197;

const long double eps = 1e-7;



int main() {

	int N;

	scanf("%d", &N);



	// 現在の場所

	int now_t = 0, now_x = 0, now_y = 0;

	// 次に行く場所

	int t, x, y;



	REP(i, N) {

		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;

	}



	cout << "Yes" << endl;

	return 0;

}

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

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

}

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

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

}

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

    return 0;

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

}

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

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

}

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

}

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

    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;

}

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

    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;

}

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

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;

}

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

}

// Faster C++ solution for the same problem (measured speedup: 5.29153389803028x):


#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 <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;

}

// Faster C++ solution for the same problem (measured speedup: 5.3054408401176705x):


#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 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.292116564005812x):


#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 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;

}

// Faster C++ solution for the same problem (measured speedup: 5.294810141911694x):


#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;

    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;

}

// Faster C++ solution for the same problem (measured speedup: 5.2774749263684555x):


#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<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;

}

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

using namespace std;

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||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

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

}

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

using namespace std;

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||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  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.284778618682105x):
#include<cstdio>

using namespace std;

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||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  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++)

    {

        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;

}

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

using namespace std;

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||(t-x-y)%2!=0)

  	{

  	  printf("No");

	  return 0;	

	}

  }

  printf("Yes");

  return 0;

}