#include <bits/stdc++.h>
#define int long long
#define range(i, a, b) for(auto i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const long double EPS = 1e-8;

signed main() {
	int n;
	cin >> n;
	map <string, int> cnt;
	rep (i, n) {
		int w;
		cin >> w;
		string num = "123";
		rep (j, w) {
			int a;
			cin >> a;
			if (a) swap(num[1], num[2]);
			else swap(num[0], num[1]);
		}
		cnt[num]++;
	}
	if (cnt["123"] >= 1 || cnt["132"] >= 2 || cnt["213"] >= 2 || cnt["231"] >= 3
	 || cnt["312"] >= 3 || cnt["321"] >= 2 || cnt["231"] >= 1 && cnt["312"] >= 1
	 || (cnt["231"] >= 1 || cnt["312"] >= 2) && cnt["213"] >= 1 && cnt["321"] >= 1
	 || (cnt["312"] >= 1 || cnt["231"] >= 2) && cnt["132"] >= 1 && cnt["321"] >= 1
	 || cnt["231"] >= 1 && cnt["132"] >= 1 && cnt["213"] >= 1
	 || cnt["312"] >= 1 && cnt["132"] >= 1 && cnt["213"] >= 1 ) {
		cout << "yes" << endl;
	} else {
		cout << "no" << endl;
	}
	return 0;
}
