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

        }

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

}
// 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;

        }

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

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

using namespace std;

int main(){

    int n,a,b,c;

    cin>>n;

    while(cin>>a>>b>>c){

        if(b+c>a) return cout<<"No"<<endl,0;

        if((b+c)%2==0 && a%2) return cout<<"No"<<endl,0;

        if((b+c)%2 && a%2==0) return cout<<"No"<<endl,0;

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

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

using namespace std;

int main()

{

    int m;

    cin>>m;

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

    {

        int t,x,y;

        cin>>t>>x>>y;

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

        {cout<<"No";return 0;}

    }

    cout<<"Yes";return 0;

}

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

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

#include<cstdio>

using namespace std;

int n,a,b,c;

bool flag=1;

int main()

{

	cin>>n;

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

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

	 a=a-c-b;

	 if(a<0||(a%2==1))

	 flag=0;

	}

    if(flag==0)

	{cout<<"No";

	}

	else

	cout<<"Yes";

	return 0;	

}

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

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

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

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

#define E exit(0);

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)puts("No"),E

        if((x+y)%2==0&&t%2)puts("No"),E

        if((x+y)%2&&t%2==0)puts("No"),E

    }

    puts("Yes");E

}

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

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

#include <cmath>



int main(int argc, char** argv)

{

    int prev_time = 0;

    int prev_x = 0;

    int prev_y = 0;

    int n = 0;

    bool is_success = true;



    std::cin >> n;



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

    {

        int cur_time, cur_x, cur_y = 0;



        std::cin >> cur_time >> cur_x >> cur_y;



        int diff_time = cur_time - prev_time;

        int diff_x = std::abs(cur_x - prev_x);

        int diff_y = std::abs(cur_y - prev_y);



        if ((diff_time % 2 != (diff_x + diff_y) % 2) ||

            (diff_time < diff_x + diff_y))

        {

            is_success = false;

        }



        cur_time = prev_time;

        cur_x = prev_x;

        cur_y = prev_y;

    }



    std::string result = is_success ? "Yes" : "No";

    std::cout << result << std::endl;



}


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

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

using namespace std;

struct f{

       int a;

       int b;

       int c;

       };

f aa[100005];

int main(){

    int n;

    cin>>n;

    int m=0;

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

            cin>>aa[i].a>>aa[i].b>>aa[i].c;

    }

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

            int k=aa[i].b+aa[i].c;

            if(aa[i].a<k){

                          m=1;

                          break;

            }

            if((aa[i].a-k)%2==1){

                                 m=1;

                                 break;

            }

    }

    if(m==1){

             cout<<"No"<<endl;

             }

    else{

         cout<<"Yes"<<endl;

         }

         return 0;

}


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

}
// 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<bits/stdc++.h>

using namespace std;

int main(){

    int n,a,b,c;

    cin>>n;

    while(cin>>a>>b>>c){

        if(b+c>a) return cout<<"No"<<endl,0;

        if((b+c)%2==0 && a%2) return cout<<"No"<<endl,0;

        if((b+c)%2 && a%2==0) return cout<<"No"<<endl,0;

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

{

    int m;

    cin>>m;

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

    {

        int t,x,y;

        cin>>t>>x>>y;

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

        {cout<<"No";return 0;}

    }

    cout<<"Yes";return 0;

}

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

using namespace std;

int n,a,b,c;

bool flag=1;

int main()

{

	cin>>n;

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

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

	 a=a-c-b;

	 if(a<0||(a%2==1))

	 flag=0;

	}

    if(flag==0)

	{cout<<"No";

	}

	else

	cout<<"Yes";

	return 0;	

}

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

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

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

        {

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

#define E exit(0);

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)puts("No"),E

        if((x+y)%2==0&&t%2)puts("No"),E

        if((x+y)%2&&t%2==0)puts("No"),E

    }

    puts("Yes");E

}

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



int main(int argc, char** argv)

{

    int prev_time = 0;

    int prev_x = 0;

    int prev_y = 0;

    int n = 0;

    bool is_success = true;



    std::cin >> n;



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

    {

        int cur_time, cur_x, cur_y = 0;



        std::cin >> cur_time >> cur_x >> cur_y;



        int diff_time = cur_time - prev_time;

        int diff_x = std::abs(cur_x - prev_x);

        int diff_y = std::abs(cur_y - prev_y);



        if ((diff_time % 2 != (diff_x + diff_y) % 2) ||

            (diff_time < diff_x + diff_y))

        {

            is_success = false;

        }



        cur_time = prev_time;

        cur_x = prev_x;

        cur_y = prev_y;

    }



    std::string result = is_success ? "Yes" : "No";

    std::cout << result << std::endl;



}


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

struct f{

       int a;

       int b;

       int c;

       };

f aa[100005];

int main(){

    int n;

    cin>>n;

    int m=0;

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

            cin>>aa[i].a>>aa[i].b>>aa[i].c;

    }

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

            int k=aa[i].b+aa[i].c;

            if(aa[i].a<k){

                          m=1;

                          break;

            }

            if((aa[i].a-k)%2==1){

                                 m=1;

                                 break;

            }

    }

    if(m==1){

             cout<<"No"<<endl;

             }

    else{

         cout<<"Yes"<<endl;

         }

         return 0;

}


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

	int n;

	cin>>n;

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

		int q,w,e;

		cin>>q>>w>>e;

		int zong=w+e;

		if((q-zong)%2==1||zong>q){

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

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

}