stablegradients/pie-gem5-pairs huggingface dataset:
// 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"<<"\n";

			return 0;

		}

		if((x+y)%2==1 && t%2==0)

		{

			cout<<"No"<<"\n";

			return 0;

		}

		if((x+y)%2==0 && t%2==1)

		{

			cout<<"No"<<"\n";

			return 0;

		}

	}

	cout<<"Yes"<<"\n";

	return 0;

}

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

#include <algorithm>

using namespace std;

int n;

int main()

{

	scanf("%d",&n);

	int t,x,y;

	bool tmp=1;

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

	{

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

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

			{

				tmp=0; break;

			}

	}

	if(tmp) printf("Yes");

	else printf("No");

	return 0;

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

using namespace std;

int a,b,x,y;

int main(){

    cin>>a;

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

        cin>>b>>x>>y;

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

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

#include <algorithm>

using namespace std;

int n;

int main()

{

	scanf("%d",&n);

	int t,x,y;

	bool tmp=1;

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

	{

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

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

			{

				tmp=0; break;

			}

	}

	if(tmp) printf("Yes");

	else printf("No");

	return 0;

}
// Slower C++ solution:
// luogu-judger-enable-o2

#include<iostream>

#include<algorithm>

#include<cstdio>

using namespace std;

int sabs(int a){

    if(a<0)return a*-1;

    return a;

}

int main(){

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

    cin>>n;

    while(n--){

        int c,a,b;

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

    return 0;

}

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

#include<cmath>

#include<stack>

#include<cstdio>

#include<queue>

#include<vector>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;

typedef long long ll;

int n,t,x,y,a,b,ans;

int main(){

	scanf("%d",&n);

	while(n--){

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

		if(abs(x-a)+abs(y-b)>t-ans||((abs(x-a)+abs(y-b))%2!=(t-ans)%2)){

			puts("No");

			return 0;

		}

		x=a,y=b,ans=t;

	}

	puts("Yes");

	return 0;

}

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

{

	int n;

	cin>>n;

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

	{

		int t,x,y;

		cin>>t>>x>>y;

		t-=x+y;

		if(t<0||t%2)

			return!(cout<<"No\n");

	}

	return!(cout<<"Yes\n");

}

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

#include<iostream>

#include<algorithm>

#include<cmath>

#include<map>

#include<queue>

#include<stack>

#include<list>

#include<set>

#include<cstring>

#include<string>

using namespace std;

int main(){

    int n;

    scanf("%d",&n);

    int t=0,x=0,y=0,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\n");

            return 0;

        }

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

            printf("No\n");

            return 0;

        }

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

    }

    printf("Yes\n");

    return 0;

}

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

        {

            cout<<"No"<<endl;

            return 0;

        }

        if((!((x+y)%2)&&t%2)||((x+y)%2&&!(t%2)))

        {

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

	cin >> n;

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

	    cin >> t >> x >> y;

	    if(abs(-x)+abs(-y)>t || abs(-x)+abs(-y)<=t && (abs(-x)+abs(-y))%2!=t%2){

	        cout << "No" << endl;

	        return 0;

	    }

	}

	cout << "Yes" << endl;

	return 0;

} 

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

	scanf("%d",&n);

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

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

		if(x+y>t||(x+y+t)%2==1){

			printf("No\n");

			return 0;

		}

	}

	printf("Yes\n");

	return 0;

}

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

{

	int i,j,k=0,n;

	cin>>n;

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

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

	{

		j=0;

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

		j+=x[i];

		j+=y[i];

		//cout<<j<<" "<<a[i]<<endl;

		if((a[i]-j)%2!=0||j>a[i])

		{

			k=1;

		}

	}	

	if(k==0)

	cout<<"Yes"<<endl;

	else

	cout<<"No"<<endl; 

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.306765829666064x):
#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){//判断，如果不行直接输出“No”

        cout<<"No";

            return 0;   

            }

            cout<<"Yes";

            return 0;

}

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

            return 0;

        }

        if( (x+y)%2==0&&t%2==1 )

        {

            cout<<"No\n";

            return 0;

        }

        if( (x+y)%2==1&&t%2==0 )

        {

            cout<<" No\n";

            return 0;

        }

    }

    cout<<" Yes\n";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.292245748992671x):
#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<x+y || (t-x-y)%2){cout<<"No\n";return 0;}

	}

	cout<<"Yes\n";

}

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

}

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

{

  int n,x,y,z,i;	

  cin>>n;

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

  {

    cin>>x>>y>>z;

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

	{

      cout<<"No"<<endl;

      return 0;

    }

  }

  cout<<"Yes"<<endl;

  return 0;

}

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

using namespace std;

int main()

{

    int n;

    cin >> n;

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

    {

        int a,b,c;

        cin >> a >> b >> c;

        b+=c;

        if(a < b||(a-b)%2 == 1){cout << "No" << endl;return 0;}

    }

    cout << "Yes" << endl;

    return 0;

}


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

			return 0;

		}

		if((x+y)%2==1 && t%2==0)

		{

			cout<<"No"<<"\n";

			return 0;

		}

		if((x+y)%2==0 && t%2==1)

		{

			cout<<"No"<<"\n";

			return 0;

		}

	}

	cout<<"Yes"<<"\n";

	return 0;

}

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

int main(){

    cin>>a;

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

        cin>>b>>x>>y;

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

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.262439952625141x):
#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 n,t,x,y,nt,nx,ny;

int main()

{

	cin>>n;

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

	{

		cin>>t>>x>>y;

        if((((int)abs(nx-x)+(int)abs(ny-y))%2==0 &&(t-nt)%2==1)||(((int)abs(nx-x)+(int)abs(ny-y))%2==1 &&(t-nt)%2==0)||(abs(nx-x)+abs(ny-y)>t-nt))

        {

            cout<<"No";

            return 0;

        }

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

	}

	cout<<"Yes"<<endl;

}

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

using namespace std;

int main()

{

    int n;

    cin>>n;

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

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

    {

        cin>>c>>a>>b;

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

using namespace std;



int ab(int a){

	if(a>=0) return a;

	return -a;

}



int main(){

	int n,nt=0,x=0,y=0,t,a,b; cin>>n;

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

		cin>>t>>a>>b;

		if(ab(a-x)+ab(b-y)>t-nt) { cout<<"No"<<endl; return 0; }

		if((ab(a-x)+ab(b-y))%2!=(t-nt)%2) { cout<<"No"<<endl; return 0; }

		x=a,y=b,nt=t;

	}

	cout<<"Yes"<<endl;

	return 0;

}

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

#include<cmath>

using namespace std;

int n,t,x,y,nt,nx,ny;

int main()

{

	cin>>n;

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

	{

		cin>>t>>x>>y;

        if((((int)abs(nx-x)+(int)abs(ny-y))%2==0 &&(t-nt)%2==1)||(((int)abs(nx-x)+(int)abs(ny-y))%2==1 &&(t-nt)%2==0)||(abs(nx-x)+abs(ny-y)>t-nt))

        {

            cout<<"No";

            return 0;

        }

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

	}

	cout<<"Yes"<<endl;

}

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

        }

        /*#include<bits/stdc++.h>

using namespace std;

int main()

{

    bool flag=true;

    int n,a,b,c,d=0,e=0;

    cin>>n;

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

    {

    	cin>>a>>b>>c;

    	if(b+c-d-e>a)

    	{

    		cout<<"No"<<endl;

    		return 0;

		}

    	else if((b+c-d-e)%2!=a%2)

    	{

    		cout<<"No"<<endl;

    		return 0;

		}

    	d=b;

    	e=c;

	}

	cout<<"Yes"<<endl;

	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;

}