#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	vector<int>v(N);
	vector<int>num(6);
	for (int i = 0; i < N; i++) {
		cin >> M;
		vector<int>box(3);
		for (int k = 0; k < 3; k++) {
			box[k] = k;
		}
		for (int k = 0; k < M; k++) {
			cin >> K;
			if (K) {
				swap(box[1], box[2]);
			}
			else {
				swap(box[0], box[1]);
			}
		}
		if (box[0] == 0 && box[1] == 1) {
			num[0]++;
		}
		else if (box[0] == 0 && box[1] == 2) {
			num[1]++;
		}
		else if(box[0] == 1 && box[1] == 0) {
			num[2]++;
		}
		else if (box[0] == 1 && box[1] == 2) {
			num[3]++;
		}
		else if (box[0] == 2 && box[1] == 0) {
			num[4]++;
		}
		else if (box[0] == 2 && box[1] == 1) {
			num[5]++;
		}
	}
	if (num[0]) {
		cout << "yes\n";
		return 0;
	}
	for (int i = 0; i < 6; i++) {
		for (int j = 0; j < 6; j++) {
			for (int k = 0; k < 6; k++) {
				for (int l = 0; l < 6; l++) {
					for (int m = 0; m < 6; m++) {
						for (int n = 0; n < 6; n++) {
							if (!i && !j && !k && !L && !m && !n) {
								continue;
							}
							vector<int>used(6);
							used[i]++;
							used[j]++;
							used[k]++;
							used[l]++;
							used[m]++;
							used[n]++;
							bool flag = true;
							for (int loop = 1; loop < 6; loop++) {
								if (used[loop] > num[loop]) {
									flag = false;
									continue;
								}
							}
							if (!flag) {
								continue;
							}
							vector<int>box(3);
							for (int k = 0; k < 3; k++) {
								box[k] = k;
							}
							if (i == 1) {
								swap(box[1], box[2]);
							}
							if (i == 2) {
								swap(box[1], box[0]);
							}
							if (i == 3) {
								swap(box[1], box[0]);
								swap(box[1], box[2]);
							}
							if (i == 4) {
								swap(box[0], box[1]);
								swap(box[0], box[2]);
							}
							if (i == 5) {
								swap(box[0], box[2]);
							}
							if (j == 1) {
								swap(box[1], box[2]);
							}
							if (j == 2) {
								swap(box[1], box[0]);
							}
							if (j == 3) {
								swap(box[1], box[0]);
								swap(box[1], box[2]);
							}
							if (j == 4) {
								swap(box[0], box[1]);
								swap(box[0], box[2]);
							}
							if (j == 5) {
								swap(box[0], box[2]);
							}
							if (k == 1) {
								swap(box[1], box[2]);
							}
							if (k == 2) {
								swap(box[1], box[0]);
							}
							if (k == 3) {
								swap(box[1], box[0]);
								swap(box[1], box[2]);
							}
							if (k == 4) {
								swap(box[0], box[1]);
								swap(box[0], box[2]);
							}
							if (k == 5) {
								swap(box[0], box[2]);
							}
							if (l == 1) {
								swap(box[1], box[2]);
							}
							if (l == 2) {
								swap(box[1], box[0]);
							}
							if (l == 3) {
								swap(box[1], box[0]);
								swap(box[1], box[2]);
							}
							if (l == 4) {
								swap(box[0], box[1]);
								swap(box[0], box[2]);
							}
							if (l == 5) {
								swap(box[0], box[2]);
							}
							if (m == 1) {
								swap(box[1], box[2]);
							}
							if (m == 2) {
								swap(box[1], box[0]);
							}
							if (m == 3) {
								swap(box[1], box[0]);
								swap(box[1], box[2]);
							}
							if (m == 4) {
								swap(box[0], box[1]);
								swap(box[0], box[2]);
							}
							if (m == 5) {
								swap(box[0], box[2]);
							}
							if (n == 1) {
								swap(box[1], box[2]);
							}
							if (n == 2) {
								swap(box[1], box[0]);
							}
							if (n == 3) {
								swap(box[1], box[0]);
								swap(box[1], box[2]);
							}
							if (n == 4) {
								swap(box[0], box[1]);
								swap(box[0], box[2]);
							}
							if (n == 5) {
								swap(box[0], box[2]);
							}
							if (box[0] == 0 && box[1] == 1) {
								cout << "yes\n";
								return 0;
							}
						}
					}
				}
			}
		}
	}
	cout << "no\n";
	return 0;
}


Measured memory_bytes: 3224