#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
const double pi = asin(1.0) * 2;
const int N = 200000;
int n;
int m;
int good[2 * N];
int was[2 * N];
int used[2 * N];
int res[2 * N];
vector<pair<int, int> > v[2 * N];
vector<int> vn[2 * N], vp[2 * N];
int go(int x, int p, int pe) {
  was[x] = 1;
  for (int i = 0; i < ((int)(v[x]).size()); i++) {
    int y = v[x][i].first;
    int z = v[x][i].second;
    if (abs(z - pe) == m) continue;
    if (was[y] == 1) {
      if (!good[y]) {
        good[y] = 1;
        used[z % m] = 1;
        if (z < m) res[z] = 1;
      }
    } else if (!was[y])
      go(y, x, z);
  }
  was[x] = 2;
  return 0;
}
int go2(int x) {
  was[x] = 1;
  for (int i = 0; i < ((int)(v[x]).size()); i++) {
    int y = v[x][i].first;
    int z = v[x][i].second;
    if (!was[y] && !used[z % m]) {
      if (z < m) res[z] = 1;
      go2(y);
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      int x;
      scanf("%d", &x);
      if (x > 0)
        vp[x - 1].push_back(i);
      else
        vn[abs(x) - 1].push_back(i);
    }
  }
  for (int i = 0; i < m; i++) {
    if (vn[i].empty() && vp[i].empty()) continue;
    if (((int)(vp[i]).size()) == 0) {
      res[i] = 0;
      good[vn[i][0]] = 1;
      if (((int)(vn[i]).size()) > 1) good[vn[i][1]] = 1;
    } else if (((int)(vn[i]).size()) == 0) {
      res[i] = 1;
      good[vp[i][0]] = 1;
      if (((int)(vp[i]).size()) > 1) good[vp[i][1]] = 1;
    } else {
      v[vp[i][0]].push_back(make_pair(vn[i][0], i + m));
      v[vn[i][0]].push_back(make_pair(vp[i][0], i));
    }
  }
  for (int i = 0; i < n; i++)
    if (!was[i]) go(i, -1, -1);
  memset(was, 0, sizeof(was));
  for (int i = 0; i < n; i++)
    if (!was[i] && good[i]) go2(i);
  for (int i = 0; i < n; i++)
    if (!was[i]) {
      printf("NO\n");
      return 0;
    }
  printf("YES\n");
  for (int i = 0; i < m; i++) printf("%d", res[i]);
  printf("\n");
  return 0;
}
