#include <stdio.h>


int main()
{
	int n,t[100001],x[100001],y[100001];
	int j, k = 0;
	scanf_s("%d",&n);
	for (j = 0; j < n; j++) {
		scanf_s("%d %d %d", &t[j], &x[j], &y[j]);
		if ((x[j-1] + 1) == x[j] || (x[j-1] - 1) == x[j] || (y[j-1] + 1) == y[j] || (y[j-1] - 1) == y[j])
			k = 1;
		else
			k = 0;
	}
	if (k == 1)
		printf("Yes\n");
	else
		printf("No\n");

    return 0;
}