#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <array>
#include <bitset>
#include <assert.h>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

void calc(VI &x, VI y){
    REP(i,3) x[i] = y[x[i]];
}

int main() {
    int n;
    cin >> n;

    VI good(3);
    REP(i,3) good[i] = i;

    VVI p(n, VI(3));
    REP(i,n){
        int w = in();
        VI tmp(3);
        REP(j,3) tmp[j] = j;

        REP(j,w){
            int x = in();
            swap(tmp[x], tmp[x+1]);
        }

        if (tmp == good){
            cout << "yes" << endl;
            return 0;
        }

        REP(j,3){
            p[i][tmp[j]] = j;
        }
    }

    REP(i,n) REP(j,i){
        VI tmp(3);
        REP(k,3) tmp[k] = k;

        calc(tmp, p[i]);
        calc(tmp, p[j]);

        if (tmp == good){
            cout << "yes" << endl;
            return 0;
        }
    }

    // REP(i,n){
    //     REP(j,3) cout << p[i][j] << " ";
    //     cout << endl;
    // }

    REP(i,n) REP(j,n) REP(l,n){
        if (i == j || j == l || l == i) continue;
        VI tmp(3);
        REP(k,3) tmp[k] = k;

        calc(tmp, p[i]);
        calc(tmp, p[j]);
        calc(tmp, p[l]);


        if (tmp == good){
            cout << "yes" << endl;
            return 0;
        }
    }

    cout << "no" << endl;

    return 0;
}
