stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
    //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;

    }

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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



using namespace std;



int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

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

    {

        cin>>c>>a>>b;

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

        {

            cout<<"No"<<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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int main(){

    int n;

    cin>>n;

    int x=0,y=0;

    int t=0;

    int a,b,c;

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

    {

        cin>>c>>a>>b;

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

        {

            cout<<"No";

            return 0;

        }

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

    }

    cout<<"Yes";

    return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int main()

{

    int n,x,y,t;

    cin>>n;

    for(int i=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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

#include<iostream>

#include<iomanip>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<cstdlib>

#include<fstream>

using namespace std;

int main()

{

	int n;

	cin>>n;

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

	{

		int t,x,y;

		cin>>t>>x>>y;

		if(x+y>t)

		{

			cout<<"No"<<endl;

			return 0;

		}

		if((x+y)%2!=t%2)

		{

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int n,t,x,y;//不用开数组

int main(){

    cin>>n;

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

        cin>>t>>x>>y;//输入每组数据

        if(!(x+y<=t&&(t-x-y)%2==0)){//判断是否符合

            cout<<"No\n";//不符合

            return 0;//避免重复输出

        }

    }

    cout<<"Yes\n";//全部符合

    return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int n,t,x,y,z,d;

int main(){

    cin>>n;

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

        cin>>t>>x>>y;

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

            cout<<"No\n";

            return 0;

        }

    }

    cout<<"Yes\n";

    return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int main() {

	int n,x[100001],y[100001],a[100001];

	cin>>n;

	for(int i=1; i<=n; i++) cin>>a[i]>>x[i]>>y[i];

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

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

			cout<<"No";

			goto no;

		}

	cout<<"Yes";

	no:

	return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int n,t,x,y;

int main()

{

    cin>>n;

    for(int i=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;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

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

}

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

using namespace std;

int main(){

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

    cin>>n;

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

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

    }

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

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

            cout<<"No";

            return 0;   

        }

	}

        

        cout<<"Yes";

        return 0;

}

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

using namespace std;

int main()

{

    int n,t,x,y;

    scanf("%d",&n);

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

    {

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

        if(x+y>t)

        {

            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;

}

// Fastest known solution for this problem: